React Native / Core
Stack
Flex layout with token-based gaps.
import { Stack } from "@stylhero/native";
Example
import { Stack, Text } from "@stylhero/native";
function StackExample() {
return (
<Stack direction="row" gap={3} align="center" justify="space-between" padding={4}>
<Text variant="strong">Total</Text>
<Text>$1,480</Text>
</Stack>
);
}
Props
| Prop | Type | Default | Description |
|---|---|---|---|
align |
ViewStyle["alignItems"] |
- | |
direction |
"column" | "row" |
"column" |
|
gap |
SpacingToken |
- | Spacing token between children. |
justify |
ViewStyle["justifyContent"] |
- | |
padding |
SpacingToken |
- | Spacing token around the content. |
wrap |
boolean |
- |
Also takes React Native's View props (testID, accessibilityHint, onLayout…), passed to that View.
Types
type SpacingToken = keyof typeof spacing;
Accessibility
- Layout only: nothing is added for screen readers. Spacing comes from tokens, and
start/endalignment mirrors for right-to-left languages.
Generated from src/components/Stack.tsx. Something wrong or missing? Open an issue.