Skip to content
Stable

Section

A section of a page, with standardised, responsive padding across screen sizes and a nested Container component (see related components below). A Section will expand to fill horizontal space and therefore has a range of use cases but was designed with full-width sections of a page in mind.

Installation

bash
npm install @nib/layout

Usage

jsx
import {Section} from '@nib/layout';

Do not style layout components

You must not apply styled-components to this component as it will interfere with the structure required for the current styling. This is true for all layout components.

Interactive demo

Singles health insurance

You want to take care of your health and wellbeing. You're after a health cover that fits the budget, but also gives you value for money.

Couples health insurance

You and your partner are focused on your health and wellbeing. You may be thinking of starting a family, so you want to make sure you have the right level of cover.

jsx

Props

PropTypeDefaultDescription
backgroundstringtransparentAdd a background color for the section. Valid options provided by underlying the Box component.

Considerations

The is a low-level component that provides you with a Box with standard padding and a nested Container. It does not provide theming options or defined child components.

If non-standard padding sizes (or none at all) are required, then you could use the Container component instead or manually recreate the component yourself using the Box component.

For example:

jsx
import {Box} from '@nib/layout';
<Box padding={{xs: 1, md: 2, xl: 3}}>
<Container>{children}</Container>
</Box>;