Skip to content

React Native Components

@vellira-ui/react-native provides native components for iOS and Android with shared Vellira tokens, TypeScript contracts, and platform-appropriate interaction APIs.

Installation

bash
pnpm add @vellira-ui/react-native

The package expects react and react-native as peer dependencies.

Components

Basic Example

tsx
import { Button, Checkbox, Input } from '@vellira-ui/react-native';
import { useState } from 'react';
import { View } from 'react-native';

export function Example() {
  const [email, setEmail] = useState('');
  const [accepted, setAccepted] = useState(false);

  return (
    <View style={{ gap: 16 }}>
      <Input label='Email' value={email} onValueChange={setEmail} />

      <Checkbox
        label='Accept terms'
        description='Required to create an account.'
        checked={accepted}
        onCheckedChange={setAccepted}
      />

      <Button onPress={() => submit({ email, accepted })}>Continue</Button>
    </View>
  );
}

Native API Conventions

  • Use onPress for actions.
  • Use style, textStyle, inputStyle, and other React Native style props.
  • Use accessibilityLabel for icon-only or visually unlabeled controls.
  • Controlled components expose value or checked; uncontrolled components use defaultValue or defaultChecked.
  • Validation belongs to the app. Components render error and invalid states.
  • Verify important flows with iOS VoiceOver and Android TalkBack on real devices.

Development

bash
pnpm --filter @vellira-ui/react-native build
pnpm --filter @vellira-ui/react-native test
pnpm --filter native-storybook start

Built for Vellira Design System.