Browse React Native
Corsair Native
React Native
The Corsair components for Expo apps, installed as source code with the shadcn CLI. They keep the web's names, variants and colours, and are written for phones: touch, screen readers and motion that stays smooth.
The web's names
Button, Card, Drawer, Toast: the same names, parts, variants and colours as the web items, so an app and its site speak one language.
Made for fingers
44 px touch areas, sheets that follow a drag, swipes that still let a list scroll, and haptics where they answer a touch.
Accessible on iOS and Android
The patterns VoiceOver and TalkBack expect: one adjustable control for a rating, modals that keep focus inside, toasts that are announced.
Motion on the native thread
Animated with the native driver for the simple things, Reanimated and Gesture Handler for gestures, and Reduce Motion respected by every item.
Installation
01Point the CLI at the registry
@corsair-native is not in the shadcn directory, so the app's
components.jsonnames it. The aliases resolve through the paths intsconfig.json(the Expo template's"@/*": ["./*"]puts items incomponents/ui,libandhooks). The Tailwind fields stay empty: the items useStyleSheet.{ "style": "new-york", "rsc": false, "tsx": true, "tailwind": { "config": "", "css": "", "baseColor": "neutral", "cssVariables": true, "prefix": "" }, "aliases": { "components": "@/components", "ui": "@/components/ui", "lib": "@/lib", "hooks": "@/hooks", "utils": "@/lib/utils" }, "registries": { "@corsair-native": "https://kevingirelli.github.io/corsair-ui/r/native/{name}.json" } }02Install the native modules
Expo picks the versions your SDK expects, which is why the items list these without one. This is all of them; each item's page lists the ones it needs.
npx expo install expo-haptics react-native-gesture-handler react-native-reanimated react-native-safe-area-context react-native-svg react-native-worklets03Add the theme, then what you need
Every item arrives with the Corsair items it uses.
lib/theme.tsholds the colours, radii, type and springs: changeprimary,primaryForegroundandringto brand the app. Components follow the device's light or dark mode;ThemeProviderforces one.npx shadcn@latest add @corsair-native/theme @corsair-native/buttonSee everything from the terminal:
npx shadcn@latest list @corsair-native04Wrap the app
Items that follow a gesture need a
GestureHandlerRootViewat the root; the toasts and the drawer sit inside theSafeAreaProvider. Mount theToasteronce, last.import { GestureHandlerRootView } from "react-native-gesture-handler"; import { SafeAreaProvider } from "react-native-safe-area-context"; import { Toaster } from "@/components/ui/toast"; export default function RootLayout() { return ( <GestureHandlerRootView style={{ flex: 1 }}> <SafeAreaProvider> {/* your screens */} <Toaster /> </SafeAreaProvider> </GestureHandlerRootView> ); }
Try them on a phone
corsair-ui has a gallery app with a screen for every item. Run it with Expo Go from a clone of the repository; the previews on these pages are its web build.
cd registry/native && npm ci && npx expo startThe source is in registry/native/gallery.
Compatibility
- Expo SDK
- 54 and 57, both checked in CI
- React Native
- 0.81 and 0.86, New Architecture
- Web
- Expo's web target, through react-native-web
- Styling
- StyleSheet and theme tokens, no Tailwind
On the web, the same components ship as Corsair UI, for React with Tailwind CSS.
Everything in it
22 items, synced from main.
Foundations1
Components19
- AlertA callout on the card surface, read as one element; default, success, warning and destructive tones colour its icon.
- AvatarA round picture of a person with initials while it loads or when it fails, in three sizes, and a group that overlaps them.
- BadgeShort status or metadata label. Solid, secondary and outline styles, plus success, warning and destructive statuses shown as a coloured dot or your own icon.
- ButtonTriggers an action. Variants default, secondary, outline, ghost, destructive, link and raised (a face that sinks into its base while pressed); sizes sm, default, lg and three square icon sizes, all with a 44 px touch area. A loading state blocks presses.
- CardA surface that groups related content: header with title, description and an action at the top right, content and footer.
- CheckboxA box to tick whose mark pops in with a spring, with an indeterminate dash and an error state.
- DrawerA bottom sheet in a Modal: it springs up, follows a drag down to close, sits clear of the home indicator and the iOS keyboard, keeps screen readers inside, and closes with the back button, the escape gesture or the overlay.
- Empty StateWhat a screen shows when there is nothing yet: an icon, a heading, a line about what to do and actions, with or without a dashed border.
- InputA single-line text field in the theme: 44 px tall, a focus ring, and an error state from aria-invalid.
- ProgressA bar for a task with a known amount that springs to each value, or an indeterminate one; screen readers hear the value.
- RatingStars for giving a score, tapped or adjusted by screen readers as one control, or for showing one read-only with fractional fills.
- Segmented ControlA switch between options of equal width with a thumb that springs to the active one; a radio group for screen readers that never goes empty.
- SeparatorA hairline between items or sections, horizontal or vertical, hidden from screen readers unless it means something.
- SkeletonA placeholder shape that pulses on the native thread while content loads, and holds still with Reduce Motion.
- SpinnerThe platform's activity indicator in the theme's muted colour, announced as Loading.
- SwitchAn on/off control whose thumb springs across while the track fades to the primary colour, in two sizes with a 44 px touch area.
- TextText in the theme's type scale: default, h1 to h4 (announced as headings), lead, large, small, muted and code. Inside a Button, Card or Badge it takes that container's colour.
- ToastBrief messages from toast() anywhere in the app, stacked at the top or bottom edge clear of the safe area: three at a time, announced to screen readers, paused while touched or in the background, and swiped away sideways or towards their edge.
- Wave RatingThe rating, animated: a finger sweeping the stars lifts them in a wave with a haptic tick per star and a tip showing the score, and letting go pops the chosen star. Same props and accessibility as rating.