Skip to content
  • Introduction
    nativecn is shadcn for Expo apps: Components you copy into your app and own, built so AI agents can build and verify whole mobile apps.
  • Installation
    Create a new Expo app with nativecn, or add nativecn to an existing one.
  • components.json
    The project file that records your Preset, Structure, aliases and agents.
  • CLI
    Every nativecn-cli command and flag: init, create, add, agents and mcp.
  • Changelog
    What changed in each nativecn release.
  • Theming
    Tokens, Colour Roles, Scale, Scheme, createStyles and fonts.
  • Presets & Styles
    Style, Base Colour, Accent Colour, Radius and fonts: chosen once, baked into your code.
  • Folder structure
    Flat and feature Structures, Destinations and the placement rule.
  • AI agents
    Rules, Skills, the nativecn MCP server, the Plugin and the Visual QA Loop.
  • Alert
    Alert, AlertTitle and AlertDescription: an inline message with Variants (default, destructive, success, warning, info), each with a default icon.
  • Avatar
    Round user image (expo-image) with fallback initials, in sizes sm, md and lg.
  • Badge
    Small status label with Variants default, secondary, outline, destructive, success and warning.
  • Button
    Button with Variants (primary, secondary, outline, ghost, destructive, link), Sizes, an icon slot, loading and status; icon-only requires aria-label.
  • Card
    Card surface with CardHeader, CardTitle, CardDescription, CardContent and CardFooter; onPress makes the whole card pressable.
  • Checkbox
    Checkbox with an optional label, controlled or uncontrolled, an indeterminate (mixed) state and a haptic tick.
  • Chip
    Chip (plain, toggle or removable, with an optional icon) and ChipGroup (single or multiple choice on the SelectionGroup Primitive), with a haptic tick.
  • Container
    Wraps a Screen: safe-area edges, scrolling, keyboard avoidance, Token padding and a max content width.
  • Drawer
    Drawer panel content for Expo Router's drawer (expo-router/drawer): DrawerContent, DrawerHeader, DrawerSection, DrawerItem (label, icon, href, badge; active from the current route) and DrawerFooter.
  • Empty State
    What a Screen or list shows when there is nothing to show yet: an icon, a title, a description and an action.
  • FormField
    Lays out a control with its Label, description and error, and links them for screen readers ("Email, text field, Enter a valid email").
  • Icon
    Every glyph: a Lucide icon at a Token size in a Colour Role, decorative unless labelled.
  • Input
    Single-line text field with Sizes, a leading icon, error/success status, a focus ring and an automatic Show/Hide password toggle.
  • InputOTP
    One-time code field: one hidden input drives N cells; numeric keyboard, SMS/Keychain autofill, paste, onComplete, error/success status and secure.
  • Label
    A field's visible label in the label type Variant, with a required marker read as "required".
  • List
    Settings-style rows: ListSection, ListSectionHeader, ListSectionFooter and ListItem (title, description, icon, trailing, chevron, destructive, onPress); FlashList-safe.
  • Progress
    A horizontal progress bar: a value 0–100 that animates, or indeterminate; role progressbar with its value.
  • RadioGroup
    RadioGroup and RadioGroupItem: a single choice from a list on the SelectionGroup Primitive, vertical or horizontal, with a haptic tick.
  • SchemeSwitcher
    Theme switcher / dark mode toggle: System, Light and Dark as SegmentedTabs, or one icon button cycling through them. Calls setScheme, which persists the choice.
  • SearchField
    Search box with a search icon, an automatic clear (×) button, a loading spinner and onSubmit from the keyboard's Search key.
  • SegmentedTabs
    In-screen tabs (not navigation): segmented or underline Variants, an animated indicator, and only the selected tab's content rendered.
  • Separator
    A hairline divider, horizontal or vertical, decorative by default.
  • Skeleton
    A placeholder shape shown while content loads; pulses unless Reduce Motion is on, hidden from screen readers.
  • Slider
    Pick a number in a range by dragging or tapping (Gesture Handler + Reanimated), snapped to steps with a haptic tick; adjustable for screen readers.
  • Spinner
    An indeterminate loading indicator in a Colour Role, announced as busy; still under Reduce Motion.
  • Switch
    A themed on/off Switch, identical on iOS and Android, with an optional label, a thumb that slides (instant under Reduce Motion) and a haptic tick.
  • TabNavigation
    The bottom tab bar: the custom tabBar of an Expo Router JS Tabs Layout, with classic and floating Variants, per-tab icons and badges from Tabs.Screen options.
  • Text
    All text: the type ramp as Variants, text Colour Roles, alignment and the font-scaling switch.
  • Textarea
    Multi-line text field that grows from minRows to maxRows, with a character counter when maxLength is set.
  • Toast
    Sonner-style Toasts: a <Toaster /> in the root Layout and toast(), toast.success/error/info/warning/dismiss. At most 3 stacked, 4s auto-dismiss, swipe away, announced, above native modals.
  • Profile header + grouped sections
    Drawer panel with a profile header (avatar, name, email, plan Badge), labelled sections (Main, Workspace, Support) and Log out pinned in the footer.
  • SaaS workspace
    Drawer panel for a SaaS workspace: logo and name with a close button, an Accent Colour onboarding item with a 5 Steps Badge, main items, a bottom group (Notifications with a count, Settings, Docs, Help) and a footer with a team switcher and the user's avatar.
  • Cover header
    Drawer panel with a dark cover (large avatar, name, View profile, a bell with a count, an overflow button and a round + action), icon items active in Accent Colour text, a divider and text-only secondary items.
  • Classic centred
    A centred sign-in Screen: logo, email and password, Forgot password, an "or" divider, then Apple and Google, and a Sign up link.
  • Social-first hero
    A social-first sign-in Screen: a dark brand hero (logo, headline, subtitle, centred) above a panel where Apple and Google lead and "Continue with email" reveals the email form.
  • Email-first, two steps
    An email-first sign-in Screen in two steps: the email, then the password, with "Email me a code instead" switching to a 6-digit code (InputOTP). Lucide chevron-left Back buttons.
  • Classic single form
    A classic sign-up Screen on one scroll: Apple and Google on top, "or", then name, email and password, a terms Checkbox with Terms and Privacy Policy links, Create account, and a Sign in link.
  • Step-by-step wizard
    A sign-up wizard, one question per step under a Progress bar: email, name, password, then a 6-digit code (InputOTP). Lucide chevron-left Back buttons; the Continue button rides above the keyboard.
  • Social-first + verify
    A brand-led, passwordless sign-up Screen: the logo and headline centred above Apple and Google; "Sign up with email" reveals the email field, and Send code moves on to a 6-digit code (InputOTP).
  • announce
    Reliable screen-reader announcements on iOS and Android (Button and Input status, Toast, error, success and warning Alerts).
  • FocusChain
    Automatic Next/Done between fields in on-screen order; Done submits the form.
  • FormField context
    Links a field to its label, description and error for screen readers; passes status, disabled and required down.
  • Keyboard
    KeyboardProvider setup, a scroll view that keeps the focused field above the keyboard, and a footer that keeps a form's main button above it.
  • Portal
    Renders content above every Screen (above native modals on iOS), layered and safe-area aware.
  • Pressable
    Pressed look from a Style Slot, tap area extended to 48, no handlers while disabled or loading, optional haptics, role and aria-* states.
  • SelectionGroup
    Single or multiple choice within a group, with radio, tab or checkbox roles and selected states.
  • useControllableState
    One implementation of controlled and uncontrolled values for form controls.
  • useMotion
    Enter/exit animations and timing/spring configs from the motion Tokens; instant when Reduce Motion is on.
  • Theme
    Tokens, Scale, Colour Roles, ThemeProvider, createStyles and the navigation theme.

Cover header

Drawer panel with a dark cover (large avatar, name, View profile, a bell with a count, an overflow button and a round + action), icon items active in Accent Colour text, a divider and text-only secondary items.

View as Markdown
Blocknavigation
Style

Light

Dark

Your app is ready.

Inter body text, Inter headings.

smmdlgxl
you@example.com
Continue
This needs Expo Router (a navigation Layout), so it can't run in the browser. The card shows your Preset's Tokens; run it in an app to see it live.Default Preset a0: Vega, neutral, neutral accent, default radius, Inter.Change Preset

Installation

$npx nativecn-cli@latest add drawer-03

Also installs: drawer, avatar, badge, button, pressable, separator, text, theme.

Packages: expo-router, lucide-react-native@^1.51.0, react-native-svg.

What makes it different

A consumer or commerce app drawer: a dark profile cover that stays dark in both Schemes (with a light status bar over it while the drawer is open), and items that show the current route by Accent Colour text and icon, with no background.

Block Variants

  • drawer-01 – Profile header + grouped sections: The familiar Gmail/Slack drawer: who is signed in on top, items grouped under small headings, Log out at the bottom; the active item sits on a muted background.
  • drawer-02 – SaaS workspace: A product workspace: an Accent-tinted onboarding Checklist on top, a second group pushed to the bottom, and a team switcher and account button in the footer instead of a profile header.
  • drawer-03 (this page) – Cover header: A consumer or commerce app drawer: a dark profile cover that stays dark in both Schemes (with a light status bar over it while the drawer is open), and items that show the current route by Accent Colour text and icon, with no background.

Accessibility

  • Each item is a DrawerItem: role link with aria-selected while its route is active, or role button for an action without href.
  • An item's visible label is its accessible name.
  • Items are 48 high in Vega and 40 in Nova, with the tap area extended to 48.
  • The bell is an icon-only Button named "Notifications, <count> unread"; its count Badge is hidden from screen readers.
  • The overflow and + buttons are icon-only Buttons named "More" and "Create".
  • View profile has role link; the initials Avatar is decorative.

Notes

In app/(drawer)/_layout.tsx, with Expo Router's drawer from expo-router/drawer (never @react-navigation/drawer or the npm package expo-drawer): <Drawer drawerContent={(props) => <Drawer03 {...props} />} />. Spread every drawerContent prop in, so items can close the drawer. Tapping an item navigates and closes the drawer; the backdrop and the system back gesture also close it. Names, avatars, counts, items and routes are placeholders: rename them and point each href at a route in your drawer Layout. Item heights follow the drawer.item Style Slot (Vega 48, Nova 40), and the panel keeps clear of the status bar and home indicator.

Source

The Vega Style's code, exactly as add copies it into your app.

{components}/drawer-03/index.tsx

// drawer-03: cover header. The panel of a drawer Layout, built from the drawer Components on
// Expo Router's own drawer (`expo-router/drawer`; never install `@react-navigation/drawer` or
// the unrelated npm package `expo-drawer`).
//
// In app/(drawer)/_layout.tsx:
//   <Drawer
//     drawerContent={(props) => (
//       <Drawer03 {...props} onNotificationsPress={openInbox} onCreatePress={create} />
//     )}
//     screenOptions={{ drawerStyle: { width: 330 } }}
//   />
//
// The cover is dark in both Schemes: it renders the dark Scheme's Colour Roles through a nested
// ThemeProvider. The name, counts, items and routes are placeholders: rename them to your app's.
import { router } from "expo-router";
import { getDrawerStatusFromState } from "expo-router/drawer";
import {
  Bell,
  EllipsisVertical,
  History,
  House,
  Plus,
  ShoppingCart,
  Store,
} from "lucide-react-native";
import { StatusBar, View } from "react-native";

import { Avatar } from "@/components/avatar";
import { Badge } from "@/components/badge";
import { Button } from "@/components/button";
import {
  DrawerContent,
  DrawerHeader,
  DrawerItem,
  DrawerSection,
  type DrawerContentProps,
} from "@/components/drawer";
import { Pressable } from "@/components/primitives/pressable";
import { Separator } from "@/components/separator";
import { Text } from "@/components/text";
import { ThemeProvider, colors, createStyles } from "@/theme";

export type Drawer03Props = DrawerContentProps & {
  /** Runs when the bell in the cover is pressed. */
  onNotificationsPress?: () => void;
  /** Runs when the overflow (⋮) button in the cover is pressed. */
  onMorePress?: () => void;
  /** Runs when the round + action in the cover is pressed. */
  onCreatePress?: () => void;
};

/** Placeholder unread count shown on the bell. */
const UNREAD = 45;

export function Drawer03({
  onNotificationsPress,
  onMorePress,
  onCreatePress,
  ...props
}: Drawer03Props) {
  const styles = useStyles();
  const open = props.state ? getDrawerStatusFromState(props.state) === "open" : false;
  const viewProfile = () => {
    router.navigate("/profile");
    props.navigation?.closeDrawer();
  };

  return (
    <DrawerContent {...props}>
      {/* The cover is dark in both Schemes, so the status bar over it is light while it's open. */}
      {open ? <StatusBar barStyle="light-content" /> : null}
      <DrawerHeader style={styles.cover}>
        <ThemeProvider scheme="dark">
          <Cover
            onViewProfile={viewProfile}
            onNotificationsPress={onNotificationsPress}
            onMorePress={onMorePress}
            onCreatePress={onCreatePress}
          />
        </ThemeProvider>
      </DrawerHeader>

      <DrawerSection>
        <DrawerItem label="Home" icon={House} href="/" variant="text" />
        <DrawerItem label="Shop" icon={Store} href="/shop" variant="text" />
        <DrawerItem label="Shopping cart" icon={ShoppingCart} href="/cart" variant="text" />
        <DrawerItem label="Same-day delivery" icon={History} href="/delivery" variant="text" />
      </DrawerSection>

      <Separator />

      <DrawerSection>
        <DrawerItem label="Invite friends" href="/invite" variant="text" />
        <DrawerItem label="Find friends" href="/friends" variant="text" />
        <DrawerItem label="Account" href="/account" variant="text" />
        <DrawerItem label="Settings" href="/settings" variant="text" />
      </DrawerSection>
    </DrawerContent>
  );
}

type CoverProps = {
  onViewProfile: () => void;
  onNotificationsPress?: () => void;
  onMorePress?: () => void;
  onCreatePress?: () => void;
};

/** The cover's content, rendered inside a dark ThemeProvider so every Colour Role is the dark one. */
function Cover({ onViewProfile, onNotificationsPress, onMorePress, onCreatePress }: CoverProps) {
  const styles = useCoverStyles();
  return (
    <View style={styles.root}>
      <View style={styles.top}>
        <Avatar fallback="JD" size="lg" style={styles.avatar} />
        <View style={styles.actions}>
          <View>
            <Button
              variant="ghost"
              icon={Bell}
              aria-label={`Notifications, ${UNREAD} unread`}
              onPress={onNotificationsPress}
            />
            <Badge
              label={String(UNREAD)}
              aria-hidden
              importantForAccessibility="no-hide-descendants"
              style={styles.count}
            />
          </View>
          <Button variant="ghost" icon={EllipsisVertical} aria-label="More" onPress={onMorePress} />
        </View>
      </View>

      <View style={styles.identity}>
        <Text variant="h4" numberOfLines={1}>
          Jane Doe
        </Text>
        <Pressable role="link" onPress={onViewProfile} style={styles.link}>
          <Text variant="small" color="mutedForeground">
            View profile
          </Text>
        </Pressable>
      </View>

      <Button
        icon={Plus}
        size="lg"
        aria-label="Create"
        onPress={onCreatePress}
        style={styles.create}
      />
    </View>
  );
}

const useStyles = createStyles(() => ({
  // The dark Scheme's surface in both Schemes, so the cover always reads as dark.
  cover: { backgroundColor: colors.dark.muted },
}));

const useCoverStyles = createStyles((t) => ({
  root: { gap: t.spacing[3] },
  top: { flexDirection: "row", alignItems: "flex-start", justifyContent: "space-between" },
  avatar: { backgroundColor: t.colors.background },
  actions: { flexDirection: "row", alignItems: "center" },
  count: { position: "absolute", top: 0, end: 0, pointerEvents: "none" },
  identity: { gap: t.spacing[0.5], paddingEnd: t.spacing[16] },
  link: { alignSelf: "flex-start" },
  create: { position: "absolute", end: 0, bottom: 0, borderRadius: t.radius.full },
}));