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 header-distance="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 header-distance="none">
<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 header-distance="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 header-distance="none">
<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 header-distance="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 header-distance="none" 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
headerDistance header-distance Adjust layout’s distance to duet navigation component using this property. Useful if the page you’re working on doesn’t use the hero component. Basically adds top margin that matches the sizing of Duet Navigation. Can be one of: "none", "with-links", "without-links". "none" or "with-links" or "without-links" undefined
margin margin Controls the margin of the component. Can be one of: "auto", "none". "auto" or "none" "auto"
middle middle Align container vertically in the middle when the space allows it. boolean false
navDistance nav-distance Deprecated and will be removed in the future releases. Use headerDistance instead! string ""
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. Can be one of: "with-links", "without-links". "with-links" or "without-links" "with-links"
stickyTop sticky-top Adjust the distance from top of the viewport (in pixels) when the sidebar becomes sticky. number 540

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

Building Layouts

Tutorials

Using CLI Tools

Tutorials

Creating Custom Patterns

Tutorials

Server Side Rendering

Tutorials

Sharing Prototypes


Troubleshooting

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