DocsComponentsTemplatesThemesGitHub

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.json

Guidelines

  • direction="row" for horizontal; wrap for toolbars.

Props

PropTypeRequired
direction'column' | 'row'No
gap0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 14 | 16 | stringNo
alignReact.CSSProperties['alignItems']No
justifyReact.CSSProperties['justifyContent']No
wrapbooleanNo
askeyof React.JSX.IntrinsicElementsNo
classNamestringNo
styleReact.CSSPropertiesNo
childrenReact.ReactNodeNo

Edit this example on GitHub