DensityContainer

Alpha component

DensityContainer component is subject to major changes and is for experimentation purposes only. Not recommended for use in production software.

This container can be used to change the density of its children.

Import

import { DensityContainer } from '@contentful/f36-density-container';

Examples

Usage

  • A low density results in the default experience.
  • A high density results in a denser UI, allowing more content and actions to fit on a single screen.

Props (API reference)

Open in Storybook

Name

Type

Default

children
required
ReactNode

density
required
"low"
"high"

The density of the container: - A `low` density results in the default UI. - A `high` density results in a denser UI, allowing more content and actions to fit on a single screen.

className
string

CSS class to be appended to the root element

testId
string

A [data-test-id] attribute used for testing purposes

Density support

To enable density support in your component, use the useDensity hook from @contentful/f36-utils.