Layout

Section

Groups optional content under a heading, description and action. Levels 2 and 3 use --cinder-text-lg. A Section ends at its header when the children snippet is absent or renders nothing.

import { Section } from '@lostgradient/cinder';
sectionheadinglayout
01

Overview

Reference usage

Section groups content under a heading with no box. It takes a heading, an optional description, an optional action aligned with the heading, and the content. Space, not a surface or a border, separates one section from the next. The content is a block, so its children never shrink inside a flex or scroll parent.

Levels 2 and 3 both use --cinder-text-lg, so a level 3 title sits above the base-size terms it heads. Levels 4 to 6 use the small size in muted text. Pick the heading level that follows the page outline without skipping a level.

A Section ends at its header when you omit the content or the children snippet renders nothing. With content, --cinder-space-3 separates it from the header.

Usage

svelte
<script lang="ts">
  import { Button, Section } from '@lostgradient/cinder';
</script>

{#snippet actions()}
  <Button size="sm" variant="secondary">See all</Button>
{/snippet}

<Section title="Upcoming" description="Next seven days" {actions}>
  <p>Nothing scheduled.</p>
</Section>

Sections side by side or in a gap

In a Stack rhythm="page", a Section takes its step from the stack. The stack uses --cinder-space-8 before a Section or a wrapper whose first child is a Section.

A section that directly follows another section takes a --cinder-space-8 top margin, the space between sections in a page's flow. A flex or grid parent that spaces its sections with gap therefore gives each section a wrapper of its own: two adjacent sections in a gap container add that margin to the gap, so stacked sections sit twice as far apart and, side by side, the second one starts lower than the first.

svelte
<script lang="ts">
  import { Section } from '@lostgradient/cinder';
</script>

<div class="bands">
  <div><Section title="Workflow activity"><p>No workflow activity yet.</p></Section></div>
  <div><Section title="Agent activity"><p>No agent activity yet.</p></Section></div>
</div>

<style>
  .bands {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--cinder-space-8);
  }
</style>
Live preview

A heading, an action and content

Upcoming

The next seven days

Two bars and a rooftop are open late on Friday.

Saved

Nothing saved yet.

02

When to use

Use when
  • Grouping content under a heading on a page or in a panel without drawing a boxed surface around it.
  • Pairing a heading with an action such as "Add" or "See all" above a list.
Avoid when
  • The content needs its own raised surface or an edge — use card.
  • Introducing a whole page with eyebrow label and tabs — use section-heading.
03

Examples

A heading, an action and content

A section is a heading with an optional description and action, then its content. Space separates it from the next section; nothing is boxed.

A tall section keeps every child

The content is a block, so children that clip their overflow are never squeezed inside a flex or scroll parent.

04

Props

Props for section
Name
Type
Default
Description
title required text The section's heading text.
description text Supporting line under the heading, in muted text.
level 23456 2 Heading level of the title. Pick the level that fits the page outline.
actions snippet Controls aligned with the heading, such as an "Add" or "See all" button. They never make the header taller than its title.
children snippet The section's content. Children never shrink inside a flex or scroll parent.