HeroUI Native is a component library built on **Uniwind (Tailwind CSS for React Native)** and **React Native**, providing accessible, customizable UI components for mobile applications. * * * **This guide is for HeroUI Native ONLY.** Do NOT use any prior knowledge of HeroUI React (web) patterns.
@heroui/react@betaheroui-native// DO NOT DO THIS - React web pattern import { Button } from "@heroui/react"; import "./styles.css"; // CSS files don't work in React Native <Button className="bg-blue-500">Click me</Button>; `### CORRECT (Native patterns)` // DO THIS - Native pattern (Uniwind, React Native components) import { Button } from "heroui-native"; <Button variant="primary" onPress={() => console.log("Pressed!")}> Click me </Button>;
primary, secondary, tertiary) over visual descriptions# List all available components node scripts/list_components.mjs # Get component documentation (MDX) node scripts/get_component_docs.mjs Button node scripts/get_component_docs.mjs Button Card TextField # Get theme variables node scripts/get_theme.mjs # Get non-component docs (guides, releases) node scripts/get_docs.mjs /docs/native/getting-started/theming
https://v3.heroui.com/docs/native/components/{component-name}.mdxhttps://v3.heroui.com/docs/native/components/button.mdxhttps://v3.heroui.com/docs/native/components/dialog.mdxhttps://v3.heroui.com/docs/native/components/text-field.mdxhttps://v3.heroui.com/docs/native/getting-started/{topic}.mdxnpm i heroui-nativenpm i react-native-reanimated react-native-gesture-handler react-native-safe-area-context @gorhom/bottom-sheet react-native-svg react-native-worklets tailwind-merge tailwind-variantsnpx create-expo-app MyApp cd MyApp npm i heroui-native uniwind tailwindcss npm i react-native-reanimated react-native-gesture-handler react-native-safe-area-context @gorhom/bottom-sheet react-native-svg react-native-worklets tailwind-merge tailwind-variants `2. **Create `global.css`:**` @import "tailwindcss"; @import "uniwind"; @import "heroui-native/styles"; @source "./node_modules/heroui-native/lib"; `3. **Wrap app with providers:**` import { GestureHandlerRootView } from "react-native-gesture-handler"; import { HeroUINativeProvider } from "heroui-native"; import "./global.css"; export default function Layout() { return ( <GestureHandlerRootView style={{ flex: 1 }}> <HeroUINativeProvider> <App /> </HeroUINativeProvider> </GestureHandlerRootView> ); }
HeroUINativeProviderGestureHandlerRootView from react-native-gesture-handlerCard.Header, Card.Body)onPress event handlersPlatform.OS for iOS/Android differences<Card> <Card.Header> <Card.Title>Title</Card.Title> <Card.Description>Description</Card.Description> </Card.Header> <Card.Body>{/* Content */}</Card.Body> <Card.Footer>{/* Actions */}</Card.Footer> </Card>
Card.Header)primarysecondarytertiarydangerdanger-softghostoutlineglobal.css:@theme { --color-accent: hsl(260, 100%, 70%); --color-accent-foreground: hsl(0, 0%, 100%); } `**Get current theme variables:**` node scripts/get_theme.mjs `**Access theme colors programmatically:**` import { useThemeColor } from "heroui-native"; const accentColor = useThemeColor("accent"); `**Theme switching (Light/Dark Mode):**` import { Uniwind, useUniwind } from "uniwind"; const { theme } = useUniwind(); Uniwind.setTheme(theme === "light" ? "dark" : "light");
https://v3.heroui.com/docs/native/getting-started/theming.mdx