Skip to content

Stack

import { Stack } from '@yarcl/react';
gap="xs"123
gap="md"123
gap="xl"123
<Stack gap="md">
<Heading level={2}>Profile</Heading>
<Field label="Name"><Input /></Field>
</Stack>

gap accepts the keys of your spacing and defaults to defaults.gap. Use as to render a semantic element (section, form, ul, nav …); list styles are reset.

Spacing props accept typed breakpoint maps. See responsive props for supported props, defaults and examples.

Accepts every native <div> attribute.

PropTypeDefaultDescription
alignResponsive<Align>Cross-axis alignment of children, as a scalar or breakpoint map.
asLayoutElement'div'Element to render.
gapResponsive<Spacing>configconfig.defaults.gapSpace between children, from the spacing config. Accepts a scalar or breakpoint map.
justifyResponsive<Justify>Main-axis distribution of children, as a scalar or breakpoint map.