Skip to main content

Layout
Ready

Layout component, while not visible in the user interface itself, provides a structure for other components using a one or two column layout system.

Examples

Open in new window
<duet-layout margin="none">
<div slot="main">
<duet-card heading="Main">Main content</duet-card>
<duet-card heading="More main content">Main content</duet-card>
</div>
</duet-layout>
Open in new window
<duet-layout>
<div slot="top">
<duet-alert icon="messaging-alert">
A simple alert with an icon on left!
</duet-alert>
</div>
<div slot="main">
<duet-card heading="Main">Main content</duet-card>
<duet-card heading="More main content">Main content</duet-card>
</div>
</duet-layout>
Open in new window
<duet-layout margin="none">
<div slot="main">
<duet-card heading="Main">Main content</duet-card>
</div>
<div slot="sidebar">
<duet-card heading="Sidebar">Sidebar content</duet-card>
</div>
</duet-layout>
Open in new window
<duet-layout>
<div slot="top">
<duet-alert icon="messaging-alert">
A simple alert with an icon on left!
</duet-alert>
</div>
<div slot="main">
<duet-card heading="Main">Main content</duet-card>
</div>
<div slot="sidebar">
<duet-card heading="Sidebar">Sidebar content</duet-card>
</div>
</duet-layout>
Open in new window
<duet-layout margin="none" center>
<div slot="main">
<duet-card heading="Main">Main content</duet-card>
<duet-card heading="More main content">Main content</duet-card>
</div>
</duet-layout>
Open in new window
<duet-layout center>
<div slot="top">
<duet-alert icon="messaging-alert">
A simple alert with an icon on left!
</duet-alert>
</div>
<div slot="main">
<duet-card heading="Main">Main content</duet-card>
<duet-card heading="More main content">Main content</duet-card>
</div>
</duet-layout>
</duet-layout>

Properties #

Property Attribute Description Type Default
center center Center align all direct children of this component. boolean false
margin margin Controls the margin of the component. "auto" | "none" "auto"
middle middle Align container vertically in the middle when the space allows it. boolean false
sticky sticky Makes the sidebar stick to the top of the window when scrolling down. boolean false
stickyDistance sticky-distance Adjust sticky sidebar’s distance to duet navigation component using this property. "with-links" | "without-links" "with-links"
tabs tabs If set to true, the sidebar position will be adjusted to take tabs inside main content area into account. boolean false

Slots #

Slot Description
"main" The layout component’s primary content. Use this for the main content on the page.
"sidebar" The layout component’s sidebar content. Use this for content that is related to the content in the main slot.
"top" This is a full-width content area above the main and sidebar slots. Could be used to show for example alert messages.

Integration

For integration, event and theming guidelines, please see Using Components. This documentation explains how to implement and use Duet’s components across different technologies like Angular, React or Vanilla JavaScript.



Tutorials

Follow these practical tutorials to learn how to build simple page layouts using Duet’s CSS Framework, Web Components and other features:

Tutorials

Abstract

Tutorials

Building Layouts

Tutorials

Using CLI Tools

Tutorials

Creating Custom Patterns

Tutorials

Server Side Rendering

Tutorials

Sharing Prototypes

Tutorials

Usage With Markdown

Tutorials

VS Code

Tutorials

Zeplin


Troubleshooting

If you experience any issues while using a component, please head over to the Support page for more guidelines and help.