v0.3.1 StableFoundation ComponentReact 18 & 19Zero Runtime CSS
Stack
Flexible spacing and alignment in a row or column.
Interactive preview
Space to compose.
Choose an action.
Usage
import { Stack, Button } from "@devvy-ui/react";
<Stack direction="row" wrap gap="0.75rem"><Button>Save</Button><Button variant="outline">Cancel</Button></Stack>API reference
Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:
| Prop | Type | Default | Description |
|---|---|---|---|
| direction | row | column | column | Layout axis. |
| gap / align / justify | CSS gap / alignment | 1rem / stretch / start | Spacing and child alignment. |
| wrap | boolean | false | Allow items to wrap. |
Accessibility & behavior
Platform Behavior & Guidelines
DOM order remains reading/tab order. Prefer wrapping over horizontal overflow. Native div attributes, refs and style overrides are supported. No role or interaction is invented.
Source ownership
Run npx @devvy-ui/cli init once in your React project, then add the source:
npx @devvy-ui/cli add stackMake the source yours.
Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.
Stack.tsxREACT / TSX
Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.