MCPcopy Create free account
hub / github.com/vanilla-extract-css/vanilla-extract / Stack

Function Stack

site/src/system/Stack/Stack.tsx:15–41  ·  view source on GitHub ↗
({
  children,
  space,
  align,
}: {
  children: ReactNode;
  space: BoxProps['paddingBottom'];
  align?: ResponsiveValue<'left' | 'center' | 'right'>;
})

Source from the content-addressed store, hash-verified

13} as const;
14
15export const Stack = ({
16 children,
17 space,
18 align,
19}: {
20 children: ReactNode;
21 space: BoxProps['paddingBottom'];
22 align?: ResponsiveValue<'left' | 'center' | 'right'>;
23}) => {
24 const stackItems = Children.toArray(children);
25 const alignItems = align
26 ? mapResponsiveValue(align, (value) => alignToFlexAlign[value])
27 : undefined;
28
29 return (
30 <Box display="flex" flexDirection="column" alignItems={alignItems}>
31 {stackItems.map((item, index) => (
32 <Box
33 key={index}
34 paddingBottom={index !== stackItems.length - 1 ? space : undefined}
35 >
36 {item}
37 </Box>
38 ))}
39 </Box>
40 );
41};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…