Description
Layout.FlexContainer
is a building block for flexbox based layout of contents and components.
Demos
No properties
FlexItem
FlexItem
FlexItem
FlexItem
<Layout.Card><Layout.FlexContainer><Layout.FlexItem><TestElement>FlexItem</TestElement></Layout.FlexItem><Layout.FlexItem><TestElement>FlexItem</TestElement></Layout.FlexItem><Layout.FlexItem><TestElement>FlexItem</TestElement></Layout.FlexItem><Layout.FlexItem><TestElement>FlexItem</TestElement></Layout.FlexItem></Layout.FlexContainer></Layout.Card>
Row with FlexItem
FlexItem
FlexItem
FlexItem
FlexItem
<Layout.FlexContainer direction="row"><Layout.FlexItem><TestElement>FlexItem</TestElement></Layout.FlexItem><Layout.FlexItem><TestElement>FlexItem</TestElement></Layout.FlexItem><Layout.FlexItem><TestElement>FlexItem</TestElement></Layout.FlexItem><Layout.FlexItem><TestElement>FlexItem</TestElement></Layout.FlexItem></Layout.FlexContainer>
justify="center"
Row with FlexItem, FlexItem
FlexItem
FlexItem
FlexItem
<Layout.FlexContainer direction="row" justify="center"><Layout.FlexItem><TestElement>FlexItem</TestElement></Layout.FlexItem><Layout.FlexItem><TestElement>FlexItem</TestElement></Layout.FlexItem><Layout.FlexItem><TestElement>FlexItem</TestElement></Layout.FlexItem><Layout.FlexItem><TestElement>FlexItem</TestElement></Layout.FlexItem></Layout.FlexContainer>
justify="flex-end"
Row with FlexItem, FlexItem
FlexItem
FlexItem
FlexItem
<Layout.FlexContainer direction="row" justify="flex-end"><Layout.FlexItem><TestElement>FlexItem</TestElement></Layout.FlexItem><Layout.FlexItem><TestElement>FlexItem</TestElement></Layout.FlexItem><Layout.FlexItem><TestElement>FlexItem</TestElement></Layout.FlexItem><Layout.FlexItem><TestElement>FlexItem</TestElement></Layout.FlexItem></Layout.FlexContainer>
Row with Card
FlexItem
FlexItem
FlexItem
FlexItem
<Layout.FlexContainer direction="row"><Layout.Card>FlexItem</Layout.Card><Layout.Card>FlexItem</Layout.Card><Layout.Card>FlexItem</Layout.Card><Layout.Card>FlexItem</Layout.Card></Layout.FlexContainer>
Row with Field.String
<Layout.FlexContainer direction="row"><Field.String label="Label" value="Foo" /><Field.String label="Label" value="Foo" /><Field.String label="Label" value="Foo" /><Field.String label="Label" value="Foo" /></Layout.FlexContainer>
Column with FlexItem
FlexItem
FlexItem
FlexItem
FlexItem
<Layout.FlexContainer direction="column"><Layout.FlexItem><TestElement>FlexItem</TestElement></Layout.FlexItem><Layout.FlexItem><TestElement>FlexItem</TestElement></Layout.FlexItem><Layout.FlexItem><TestElement>FlexItem</TestElement></Layout.FlexItem><Layout.FlexItem><TestElement>FlexItem</TestElement></Layout.FlexItem></Layout.FlexContainer>
Column with Card
Card contents
Card contents
Card contents
Card contents
<Layout.FlexContainer direction="column"><Layout.Card>Card contents</Layout.Card><Layout.Card>Card contents</Layout.Card><Layout.Card>Card contents</Layout.Card><Layout.Card>Card contents</Layout.Card></Layout.FlexContainer>
Column with Field.String
<Layout.Card><Layout.FlexContainer direction="column"><Field.String label="Label" value="Foo" /><Field.String label="Label" value="Foo" /><Field.String label="Label" value="Foo" /><Field.String label="Label" value="Foo" /></Layout.FlexContainer></Layout.Card>
Column, space divider
<Layout.Card><Layout.FlexContainer direction="column" divider="space"><Field.String label="Label" value="Value" /><Field.String label="Label" value="Value" /><Field.String label="Label" value="Value" /><Field.String label="Label" value="Value" /></Layout.FlexContainer></Layout.Card>
Column, line divider
<Layout.Card><Layout.FlexContainer direction="column" divider="line"><Field.String label="Label" value="Value" /><Field.String label="Label" value="Value" /><Field.String label="Label" value="Value" /><Field.String label="Label" value="Value" /></Layout.FlexContainer></Layout.Card>
Properties
Property | Type | Description |
---|---|---|
className | string | (optional) Outer DOM element class name |
direction | string | (optional) Direction of sub components. Can be: row or column . |
wrap | boolean | (optional) True to wrap contents if there is not enough space. |
justify | string | (optional) How to place sub components if there is space available in the container. Can be: flex-start , flex-end , center , space-between , space-around or space-evenly . |
divider | string | (optional) How to separate sub components. Can be: space or line . |
spacing | string or false | (optional) How much space between sub components. Can be medium , small or false for no spacing. |
children | React.Node | (optional) Contents. |