Skip to content

<sessions-section>

A titled group with an optional action beside the title.

Preact & React<Section>GroupLayoutDrawn asSection

Preview

Drawn by the same renderers Sessions uses for your extension, from the DOM example beside it, without its event handlers.

When to use it

Groups related content under a small heading. A child with slot="action" renders at the end of the heading row — a button or a badge.

In Preact and React, import the component of the same name from @sessions/apps/preact or @sessions/apps/react. Attributes become camelCase props, a boolean attribute is a boolean prop, and an event is an on prop that receives the event’s detail.

Attributes

Attribute
heading
The section title.Prop heading
secondary
A subdued line under the title.Prop secondary

Slots

slot="action"
Rendered beside the heading, at the trailing edge.
Example
import {Section, Button, Link} from '@sessions/apps/preact';

<Section heading="Playlist" secondary="Spotify">
  <Button slot="action" size="small" emphasis="subdued" onClick={change}>
    Change
  </Button>
  <Link to="https://open.spotify.com/playlist/37i9">Open playlist</Link>
</Section>

In the same group