Layout

Alpha component

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

A primitive for implementing common layout patterns seen within Contentful apps.

Import

import { Layout } from '@contentful/f36-components';
// or
import { Layout } from '@contentful/f36-layout';

Examples

Basic layout with header, sidebar and body

Props (API reference)

Open in Storybook

Name

Type

Default

children
ReactNode

The body of the layout.

className
string

CSS class to be appended to the root element

contentClassName
string

Classname that will be passed to the main content div, which holds the sidebars and children div

contentTestId
string

css
string
number
false
true
ComponentSelector
Keyframes
SerializedStyles
ArrayInterpolation<undefined>
ObjectInterpolation<undefined>
(theme: any) => Interpolation<undefined>

header
string
number
false
true
{}
ReactElement<any, string | JSXElementConstructor<any>>
ReactNodeArray
ReactPortal

leftSidebar
string
number
false
true
{}
ReactElement<any, string | JSXElementConstructor<any>>
ReactNodeArray
ReactPortal

rightSidebar
string
number
false
true
{}
ReactElement<any, string | JSXElementConstructor<any>>
ReactNodeArray
ReactPortal

testId
string

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

variant
"wide"
"fullscreen"

Defines the width of the layout and its content.

'fullscreen'