Skip to content

Stack

Used to layout its children in a vertical or horizontal stack.

Item 1
Item 2
Item 1
Item 2
// Import components
import {
Placeholder,
Stack,
} from '@fintech-sandpit/ui/react';
// Import styles (optional)
import '@fintech-sandpit/ui/style/components/placeholder.css';
import '@fintech-sandpit/ui/style/components/stack.css';
return (
<Stack spacing="md">
<Placeholder className="h-20 w-40">
Item 1
</Placeholder>
<Placeholder className="h-20 w-40">
Item 2
</Placeholder>
</Stack>
);
// Import components
import {
Placeholder,
Stack,
} from '@fintech-sandpit/ui/react';
// Import styles (optional)
import '@fintech-sandpit/ui/style/components/placeholder.css';
import '@fintech-sandpit/ui/style/components/stack.css';
return (
<Stack
orientation="horizontal"
spacing="md"
>
<Placeholder className="h-40 w-20">
Item 1
</Placeholder>
<Placeholder className="h-40 w-20">
Item 2
</Placeholder>
</Stack>
);
NameTypeDefaultDescription
orientationOrientationverticalStack orientation
spacingSize—A gap between the items
export type Orientation = 'vertical' | 'horizontal'
export type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl'
ValueClass equivalentWidth
xs.gap-xs0.5rem / 8px
sm.gap-sm0.75rem / 12px
md.gap-md1rem / 16px
lg.gap-lg1.25rem / 20px
xl.gap-xl2rem / 32px