Skip to content

Import

import { Flex } from '@dnb/eufemia'

Description

To make it easier to build application layout and form-views in line with defined design sketches, there are a number of components for layout.

  • Flex.Container is a building block for CSS flexbox based layout of contents and components.

    • Flex.Vertical can be used as an alias instead of the property direction="vertical".
    • Flex.Horizontal can be used as an alias instead of the property direction="horizontal".
  • Flex.Item is a building block for CSS flexbox based layout of contents and components.

  • Flex.Stack is an outer block element that wraps content to ensure proper layout and spacing between form elements, larger regions and headings. It stretches its content horizontally (100%).

import { Form } from '@dnb/eufemia/extensions/forms'
import { Flex } from '@dnb/eufemia'
function MyForm() {
return (
<Form.Handler>
<Flex.Stack>
<Form.MainHeading>Main heading</Form.MainHeading>
<Form.Card>...</Form.Card>
</Flex.Stack>
</Form.Handler>
)
}

You can find more related information in the Layout pages.