Skip to content

Components

An extension renders with a small set of sessions-* elements. Each is drawn by the Sessions design system on the host, so it looks native on every brand, in light and dark, in the admin and on a business’s own site.

Elements22StylingBy the host

Using the elements

Use the Preact or React components, or build a tree yourself with the html tagged template from @sessions/apps or plain DOM APIs — document.createElement("sessions-button") works.

Every element is configured through attributes (strings; a boolean attribute is on when present). The components take the same attributes as camelCase props.

Listen with addEventListener, an on<event> property in html, or an on prop on a component. A form element reports its new value in the event’s detail.

Some elements have named slots: a child with slot="media", slot="accessory" or slot="icon" is drawn in that place rather than in the body.

Anything that is not an sessions-* element is ignored by the host. There is no styling API on purpose: the host chooses colours, spacing and fonts so an extension always passes the brand’s contrast and matches its corners.
set-list.tsx
import {Section, Badge, Stack, Text} from '@sessions/apps/preact';

<Section heading="Set list">
  <Badge slot="action" tone="positive">Live</Badge>
  <Stack gap="small">
    <Text>1. Opener</Text>
    <Text>2. Encore</Text>
  </Stack>
</Section>

Layout

Typography

Actions

Forms

Rows

Loading