Demos
No properties
FlexItem
FlexItem
FlexItem
FlexItem
Code Editor
<Flex.Container> <Flex.Item> <TestElement>FlexItem</TestElement> </Flex.Item> <Flex.Item> <TestElement>FlexItem</TestElement> </Flex.Item> <Flex.Item> <TestElement>FlexItem</TestElement> </Flex.Item> <Flex.Item> <TestElement>FlexItem</TestElement> </Flex.Item> </Flex.Container>
Horizontal Flex.Item
FlexItem
FlexItem
FlexItem
FlexItem
Code Editor
<Flex.Container> <Flex.Item> <TestElement>FlexItem</TestElement> </Flex.Item> <Flex.Item> <TestElement>FlexItem</TestElement> </Flex.Item> <Flex.Item> <TestElement>FlexItem</TestElement> </Flex.Item> <Flex.Item> <TestElement>FlexItem</TestElement> </Flex.Item> </Flex.Container>
justify="center"
Horizontal Flex.Item, FlexItem
FlexItem
FlexItem
FlexItem
Code Editor
<Flex.Container justify="center"> <Flex.Item> <TestElement>FlexItem</TestElement> </Flex.Item> <Flex.Item> <TestElement>FlexItem</TestElement> </Flex.Item> <Flex.Item> <TestElement>FlexItem</TestElement> </Flex.Item> <Flex.Item> <TestElement>FlexItem</TestElement> </Flex.Item> </Flex.Container>
justify="flex-end"
Horizontal Flex.Item, FlexItem
FlexItem
FlexItem
FlexItem
Code Editor
<Flex.Container justify="flex-end"> <Flex.Item> <TestElement>FlexItem</TestElement> </Flex.Item> <Flex.Item> <TestElement>FlexItem</TestElement> </Flex.Item> <Flex.Item> <TestElement>FlexItem</TestElement> </Flex.Item> <Flex.Item> <TestElement>FlexItem</TestElement> </Flex.Item> </Flex.Container>
size
and grow
Horizontal with Code Editor
<Flex.Horizontal> <Flex.Item size={3}> <Card>Card contents</Card> </Flex.Item> <Flex.Item size={4}> <Card>Card contents</Card> </Flex.Item> <Flex.Item size={5}> <Card>Card contents</Card> </Flex.Item> <Flex.Item grow> <Card>Card contents</Card> </Flex.Item> <Flex.Item grow> <Card>Card contents</Card> </Flex.Item> <Flex.Item grow> <Card>Card contents</Card> </Flex.Item> </Flex.Horizontal>
Horizontal Field.String
Will wrap on small screens.
Code Editor
<Flex.Container> <Field.String label="Label" value="Foo" /> <Field.String label="Label" value="Foo" width="medium" /> </Flex.Container>
Vertical Flex.Item
FlexItem
FlexItem
FlexItem
FlexItem
Code Editor
<Flex.Container direction="vertical"> <Flex.Item> <TestElement>FlexItem</TestElement> </Flex.Item> <Flex.Item> <TestElement>FlexItem</TestElement> </Flex.Item> <Flex.Item> <TestElement>FlexItem</TestElement> </Flex.Item> <Flex.Item> <TestElement>FlexItem</TestElement> </Flex.Item> </Flex.Container>
Vertical aligned Card
Code Editor
<Flex.Container direction="vertical"> <Card>Card contents</Card> <Card>Card contents</Card> <Card>Card contents</Card> </Flex.Container>
Vertical line divider
Heading
Code Editor
<Card> <Flex.Container direction="vertical" divider="line"> <Form.SubHeading>Heading</Form.SubHeading> <Field.String label="Label" value="Value" /> <Field.String label="Label" value="Value" /> </Flex.Container> </Card>
Vertical aligned Field.String
Code Editor
<Card> <Flex.Container direction="vertical"> <Field.String label="Label" value="Foo" /> <Field.String label="Label" value="Foo" /> </Flex.Container> </Card>
Flex.withChildren
Code Editor
const Wrapper = Flex.withChildren(({ children }) => { return <div>{children}</div> }) render( <Flex.Container direction="vertical"> <TestElement>FlexItem 1</TestElement> <Wrapper> <TestElement>FlexItem 2</TestElement> <TestElement>FlexItem 3</TestElement> </Wrapper> <TestElement>FlexItem 4</TestElement> </Flex.Container>, )
SyntaxError: Unexpected token (1:3)