Stack
A vertical layout component that evenly distributes children with consistent spacing between each item.
Quick Start
- Installation
npm install @adaptavant/eds-core- Import
import { Stack } from '@adaptavant/eds-core';
Default
Basic example.
1
2
3
const styles = {
display: "flex",
alignItems: "center",
justifyContent: "center",
height: "5rem",
width: "5rem",
backgroundColor: "var(--background-accent)",
color: "var(--text-onPrimary)",
};
return (
<Stack
className={`
gap-4
items-stretch
`}
>
<div style={styles}>1</div>
<div style={styles}>2</div>
<div style={styles}>3</div>
</Stack>
);
API Reference
Stack
as? | 'div' | React.ElementTypeThe element type to render. Can be any valid HTML element (e.g., 'div', 'section', 'article', 'button') or a React component. |
children? | _ | React.ReactNodeThe content to be rendered inside the Box. |
className? | '' | stringCSS class names to apply to the Box. Supports Tailwind CSS utility classes. |
style? | {} | React.CSSPropertiesInline styles to apply to the Box. |