Stack
Flex stack with token gaps (gap={4} = 16px).
Code
import * as React from 'react';
import { Avatar, Stack, Text } from '@fruit-labs/design';
export default function Demo() {
return (
<Stack direction="row" gap={3} align="center">
<Avatar name="Ada Lovelace" />
<Stack gap={0}>
<b>Ada Lovelace</b>
<Text size="footnote" tone="secondary">
Owner
</Text>
</Stack>
</Stack>
);
}Install
From npm:
npm install @fruit-labs/design
import { Stack } from '@fruit-labs/design';Or copy the TypeScript source into your project:
npx shadcn@latest add https://design.fruitlabs.online/r/stack.jsonGuidelines
direction="row"for horizontal;wrapfor toolbars.
Props
| Prop | Type | Required |
|---|---|---|
direction | 'column' | 'row' | No |
gap | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 14 | 16 | string | No |
align | React.CSSProperties['alignItems'] | No |
justify | React.CSSProperties['justifyContent'] | No |
wrap | boolean | No |
as | keyof React.JSX.IntrinsicElements | No |
className | string | No |
style | React.CSSProperties | No |
children | React.ReactNode | No |