as
ElementType<any>
Component renders by default as a `div` unless another value is passed.
Creates a flexbox container with appropriate child elements based on the provided as
prop.
<Flex gap="12px"><Placeholder>Item 1</Placeholder><Placeholder>Item 2</Placeholder><Placeholder>Item 3</Placeholder></Flex>
The gap
prop can be provided as a responsive value.
<Flexgap={{mobile: '8px',tablet: '12px'}}><Placeholder>Item 1</Placeholder><Placeholder>Item 2</Placeholder><Placeholder>Item 3</Placeholder></Flex>
If the as
prop is specified as either "ul" or "ol" the children will be rendered as <li>
elements.
<Flexas="ul"gap="12px"><Placeholder>Item 1</Placeholder><Placeholder>Item 2</Placeholder><Placeholder>Item 3</Placeholder></Flex>
By default, <Flex>
elements don't wrap. Specify wrap
as true
to enable this.
<Flexgap="12px"wrap><Placeholder>Item 1</Placeholder><Placeholder>Item 2</Placeholder><Placeholder>Item 3</Placeholder><Placeholder>Item 4</Placeholder><Placeholder>Item 5</Placeholder><Placeholder>Item 6</Placeholder><Placeholder>Item 7</Placeholder><Placeholder>Item 8</Placeholder><Placeholder>Item 9</Placeholder><Placeholder>Item 10</Placeholder><Placeholder>Item 11</Placeholder><Placeholder>Item 12</Placeholder><Placeholder>Item 13</Placeholder><Placeholder>Item 14</Placeholder><Placeholder>Item 15</Placeholder></Flex>
<Flex>
defaults to a row but can also be used as a column.
<Flexdirection="column"gap="12px"><Placeholder>Item 1</Placeholder><Placeholder>Item 2</Placeholder><Placeholder>Item 3</Placeholder><Placeholder>Item 4</Placeholder><Placeholder>Item 5</Placeholder></Flex>
<Flex>
elements align to the center of the viewport. Provide a different value to change this. E.g: stretch
<FlexalignItems="stretch"direction="column"gap="12px"><Placeholder>Item 1</Placeholder><Placeholder>Item 2</Placeholder><Placeholder>Item 3</Placeholder><Placeholder>Item 4</Placeholder><Placeholder>Item 5</Placeholder></Flex>
Specify inline
as true
to render as a span
with inline-flex
applied to it.
<>This is a<Flexgap="12px"inline><Placeholder>Flex</Placeholder><Placeholder>Rendered</Placeholder><Placeholder>Inline</Placeholder></Flex>{' '}in a sentence.</>
as
ElementType<any>
Component renders by default as a `div` unless another value is passed.
gap
ConditionalStyleWithResponsiveArray<Values<{ none: number; "4px": CSSVarFunction; "8px": CSSVarFunction; "12px": CSSVarFunction; "16px": CSSVarFunction; "20px": CSSVarFunction; ... 10 more ...; "160px": CSSVarFunction; }, { ...; }>, string[] & { ...; }>
Content renders with specified gap between the rows or columns if specified.
listClassName
string
Component adds specific class to the li element.
alignItems
ConditionalStyleWithResponsiveArray<Values<("stretch" | "center" | "flex-end" | "flex-start")[], { defaultClass: string; conditions: { [x: string]: string; }; }>, string[] & { length: 4; }>
Specifies how items are laid out along the cross axis.
Default: "center"
justifyContent
ConditionalStyleWithResponsiveArray<Values<("space-between" | "stretch" | "center" | "flex-end" | "flex-start")[], { defaultClass: string; conditions: { [x: string]: string; }; }>, string[] & { length: 4; }>
Specifies how the space between and around the items is rendered.
direction
ConditionalStyleWithResponsiveArray<Values<("column" | "column-reverse" | "row" | "row-reverse")[], { defaultClass: string; conditions: { [x: string]: string; }; }>, string[] & { length: 4; }>
Content renders as a column if `column` is passed. Default is `row`.
Default: "row"
wrap
boolean
Content will wrap to multiple lines if `true` is passed. Defaults to `false`.
inline
boolean
Determines if 'flex' or 'inline-flex' should be used.
inputRef
Ref<HTMLDivElement | HTMLOListElement | HTMLUListElement>
Has to not be called ref - done because we also want to use a generic see https://gist.github.com/gaearon/1a018a023347fe1c2476073330cc5509
atoms
Applies permitted design system styles. See styling documentation for more.