datui
Color scheme

Layout

Flex

Flexbox container with gaps on the spacing scale, plus FlexItem for sizing children.

import { Flex, FlexItem } from "datui";

Playground

<Flex direction="row" gap="m" />

Examples

Gap, alignment and wrapping

One
Two
Three
Four
Five

Flex items

content
grow
content

Accessibility

  • Purely presentational. Use as to render a semantic element such as ul, nav or section.

API

Flex

Flexbox container on datui's spacing scale.

PropTypeDefaultDescription
align"center" | "start" | "end" | "stretch" | "baseline"—
alignSelfAlignSelf—
asElementType<any, keyof IntrinsicElements>—
classNamestring—
direction"row" | "column"—
display"none" | "flex" | "inline-flex"—
flexBasisLength—
flexGrownumber—
flexShrinknumber—
gapGap—Token, px number or `[row, column]` tuple.
heightLength—
justify"center" | "start" | "end" | "space-around" | "space-between" | "space-evenly"—
marginSpace—
marginBlockSpace—
marginInlineSpace—
maxHeightLength—
maxWidthLength—
minHeightLength—
minWidthLength—
noWrapboolean—
paddingSpace—
paddingBlockSpace—
paddingInlineSpace—
positionPosition—
reverseboolean—
widthLength—

FlexItem

Child of `Flex` with sizing helpers.

PropTypeDefaultDescription
alignSelfAlignSelf—
asElementType<any, keyof IntrinsicElements>—
classNamestring—
flex"content" | "grow" | "shrink"—Shorthand: `grow` fills free space, `shrink` gives way, `content` sizes to content.
flexBasisLength—
flexGrownumber—
flexShrinknumber—
heightLength—
marginSpace—
marginBlockSpace—
marginInlineSpace—
maxHeightLength—
maxWidthLength—
minHeightLength—
minWidthLength—
paddingSpace—
paddingBlockSpace—
paddingInlineSpace—
positionPosition—
widthLength—