Layout
StackPanel
Arranges its children in one line, stacked or side by side, with even spacing between them.
WAI-ARIA tested
Import
main.ts
import { StackPanel } from '@vitral/vue';Vertical
The default. Children stack top to bottom and stretch to the panel's width; the gap is the stackpanel.spacing token.
Header
Body
Footer
Orientation, spacing and alignment
The dashed frame is the panel. Align moves children across the line; justify spreads them along it.
One
Two
Three
Wrap
A horizontal stack with wrap flows onto more lines instead of overflowing.
VueReactAngularSveltePresetsTokensPass-throughUnstyledFlexboxAccessibilityLayoutPanels
API
Read from packages/vue/src/components/StackPanel/types.ts, so it says what the component actually accepts.
Props
| Name | Type | Description |
|---|---|---|
| orientation | 'vertical' | 'horizontal' | Children one below the other (the default) or side by side. |
| spacing | number | string | Space between children: a number of pixels or any CSS length. Defaults to the `stackpanel.spacing` token. |
| align | string | Cross-axis alignment (`align-items`): `start`, `center`, `end`, `baseline`, or `stretch`, the default. |
| justify | string | Main-axis distribution (`justify-content`): `start`, `center`, `end`, `space-between`… |
| wrap | boolean | Let children flow onto another line when they run out of room. |
| as | string | Component | The element or component to render: `'ul'` for a list, `'nav'`, `'form'`. |
Plus pt, dt and unstyled from BaseProps, see pass-through and unstyled mode.
Slots
| Name | Slot props | Description |
|---|---|---|
| default | — | — |