Stack
Flexible layout primitives (VStack, HStack, ZStack) for composable spacing and alignment.
v0.1.0NativeWindStyleSheetiOSAndroidExpo GoWeb
Preview
Installation
npx nativra-cli add stackWrites Stack.tsx to components/ui, rewrites imports to your aliases and records hashes in nativra.lock.json, along with 1 registry dependency. Existing files are never overwritten without asking.
Want to try it first? Open it in the playground: a real React Native project in your browser, with this item installed by the CLI.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| direction | "row" | "column" | "column" | Flex layout direction |
| align | "start" | "center" | "end" | "stretch" | "stretch" | Cross-axis alignment |
| justify | "start" | "center" | "end" | "between" | "around" | "start" | Main-axis distribution |
| gap | number | "sm" | "md" | "lg" | "md" | Spacing between children |
| wrap | boolean | false | Enables flex wrapping |
| children | React.ReactNode | required | Stacked child elements |
Source
Exactly what the CLI writes, before your import aliases are applied.
Dependencies
npm packages
- class-variance-authority^0.7.1