Skip to content
Corsair UI
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

  1. 01Point the CLI at the registry

    @corsair-native is not in the shadcn directory, so the app's components.json names it. The aliases resolve through the paths in tsconfig.json (the Expo template's "@/*": ["./*"] puts items in components/ui, lib and hooks). The Tailwind fields stay empty: the items use StyleSheet.

    {
      "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"
      }
    }
  2. 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-worklets
  3. 03Add the theme, then what you need

    Every item arrives with the Corsair items it uses. lib/theme.ts holds the colours, radii, type and springs: change primary, primaryForeground and ring to brand the app. Components follow the device's light or dark mode; ThemeProvider forces one.

    npx shadcn@latest add @corsair-native/theme @corsair-native/button

    See everything from the terminal:

    npx shadcn@latest list @corsair-native
  4. 04Wrap the app

    Items that follow a gesture need a GestureHandlerRootView at the root; the toasts and the drawer sit inside the SafeAreaProvider. Mount the Toaster once, 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 start

The 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

Hooks1

Utilities1