Skip to content

Import#

import { Section } from '@dnb/eufemia'

Description#

The Section component is a visual helper. It wraps content inside a visual section banner.

Relevant links#

Breakout / fullscreen#

Under the hood, it uses a couple of tricks to achieve an infinite fullscreen size. You do not need to do anything more than you normally would with your content. The background of the Section component will extend beyond a max-width when enabled with the breakout property.

Usage#

Many of the properties support media queries. This makes this component well suited to change its look based on screen sizes.

Each of these properties do support either a single value or an object containing one or more media query sizes:

{
small: false,
medium: true,
large: true,
}
  • breakout={boolean} or e.g. breakout={{ small: boolean }}
  • roundedCorner={boolean} or e.g. roundedCorner={{ small: boolean }}
  • outline={boolean|string} or e.g. outline={{ small: 'black' }}
  • backgroundColor={string} or e.g. backgroundColor={{ small: 'white' }}
  • textColor={string} or e.g. textColor={{ small: 'black-80' }}
  • innerSpace={string} or e.g. innerSpace={{ small: { top: 'small' } }}

Related components#

Section is part of the Content category. Other components for similar needs:

  • Accordion — to let people open and close sections of related content.
  • Avatar — to make a person, company, or profile easier to recognize.
  • Card — to group related content in a clear, separated area.
  • CountryFlag — to show a country by its flag from an ISO country code.
  • DateFormat — to show dates in the correct DNB format.
  • Heading — to create accessible page headings with the correct level.

See all in Content →

Demos#

Default Section#

Visual Section: default

Default Section with inner space#

Visual Section: default with innerSpace

Responsive inner space (padding)#

Where innerSpace do respond on different screen sizes.

Responsive innerSpace

Responsive appearance#

Where breakout, outline, roundedCorner, backgroundColor and dropShadow do respond on different screen sizes.

Responsive properties

No breakout#

No breakout

Dark surface#

Use Section or Theme.Context with surface="dark" to provide dark surface context to supporting components.

Dark surface section: anchor

Variant: divider#

Visual Section: divider

Variant: info#

Variant: error#

Error section: error

Variant: warning#

Warning section: warning

Variant: success#

Success section: success

Suggest an edit