Cover
Column layout with optional top band, a growing centered main region, and optional bottom band.
Properties
| Property | Attribute | Description | Type name | Type | Default |
|---|---|---|---|---|---|
gap | gap | Gap between regions (`none`…`xxl`; default `s`) | DuoSpacing | (typeof duoSpacingValues)[number] | "s" |
spacing | spacing | Outer padding token; when unset, matches `gap` (`none`…`xxl`) | string | string | "" |
minHeight | min-height | Minimum block size of the cover (default `100vh`) | string | string | "100vh" |
Slots
| Name | Description |
|---|---|
top | Top region (nav, logo, etc.) |
default | Main region; fills remaining space and centers content along the block axis |
bottom | Bottom region (actions, links, etc.) |
Usage
Cover is a flex column with a minimum block size (often full viewport height). Use up to three block-level regions:
slot="top"— top band (optional)- Default slot — main; grows to fill space between top and bottom and centers its content vertically
slot="bottom"— bottom band (optional)
Omit top or bottom siblings when you do not need them; the main region still expands correctly. Omit the default slot entirely when you only need top and bottom bands—the main wrapper still grows to push the bottom band to the lower edge.
<duo-cover gap="m" min-height="100vh"> <nav slot="top">…</nav> <main> <h1>Title</h1> <p>Subtitle</p> </main> <div slot="bottom">…</div></duo-cover>Top and bottom only (no centered main content):
<duo-cover gap="m" min-height="100vh"> <header slot="top">…</header> <footer slot="bottom">…</footer></duo-cover>Do
- Put primary content in the default slot (
main,section,div, etc.). - Mark optional edge bands with
slot="top"andslot="bottom"so two-child layouts stay unambiguous. - Use
gapfor space between regions; usespacingfor outer padding (likeduo-box; defaults togapwhen omitted). - Use
min-height(default100vh) on sparse full-viewport layouts.
Don’t
- Don’t use Cover for ordinary vertical lists—use
duo-stack. - Don’t rely on child order alone without slots—always mark
slot="top"andslot="bottom"on edge bands. - Don’t add a fourth vertical band—use
duo-stackinside a region instead.
Props
| Attribute | Type | Default | Description |
|---|---|---|---|
gap | DuoSpacing | s | Token for flex gap between regions (none, xxs…xxl). |
spacing | DuoSpacing | (matches gap) | Outer padding token; omit to mirror gap, or set none for edge-to-edge layout. |
min-height | string | 100vh | Minimum block size of the cover (min-block-size). |
Slots
| Slot | Description |
|---|---|
top | Top band |
| (default) | Main region; grows and centers content on the block axis |
bottom | Bottom band |