Alpha component
DensityContainer component is subject to major changes and is for experimentation purposes only. Not recommended for use in production software.
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 { DensityContainer } from '@contentful/f36-density-container';
low
density results in the default experience.high
density results in a denser UI, allowing more content and actions to fit on a single screen.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 |
To enable density support in your component, use the useDensity
hook from @contentful/f36-utils
.