Band
One band of a landing or a product page, the width of the window: a kicker, a title in the voice, a lead, then what it shows.
import { Band } from '@sypnia/ui/react'
Words beside what they explain
A sample
Twelve lines, one case
It reads like the case: who, what it needs and what happens if it fails.
- A person writes it.
- The runtime runs it.
id: place-order
actor: customer
goal: Order for todayCode
import { Band, CodeBlock, Points, useSypnia } from '@sypnia/ui/react';
export default function Split() {
const es = useSypnia().locale === 'es';
return (
<Band kicker={es ? 'Un ejemplo' : 'A sample'} title={es ? 'Doce líneas, un caso' : 'Twelve lines, one case'} size="sm" layout="split"
lead={es ? 'Se lee como el caso: quién, qué pide y qué pasa si falla.' : 'It reads like the case: who, what it needs and what happens if it fails.'}
intro={<Points items={es ? ['Lo escribe una persona.', 'Lo ejecuta el runtime.'] : ['A person writes it.', 'The runtime runs it.']} />}>
<CodeBlock title="place-order.case.yaml" lang="yaml" code={'id: place-order\nactor: customer\ngoal: Order for today'} />
</Band>
);
} Three grounds
On the page
tone plain, the ground of the page.
A step deeper
tone alt, to alternate bands.
Night on any surface
tone night, for the close of a page.
Code
import { Band, useSypnia } from '@sypnia/ui/react';
export default function Tones() {
const es = useSypnia().locale === 'es';
return (
<div>
<Band title={es ? 'Sobre la página' : 'On the page'} size="sm" lead={es ? 'tone plain, el fondo de la página.' : 'tone plain, the ground of the page.'} />
<Band tone="alt" title={es ? 'Un paso más hondo' : 'A step deeper'} size="sm" lead={es ? 'tone alt, para alternar bandas.' : 'tone alt, to alternate bands.'} />
<Band tone="night" title={es ? 'De noche en cualquier superficie' : 'Night on any surface'} size="sm" lead={es ? 'tone night, para el cierre de una página.' : 'tone night, for the close of a page.'} />
</div>
);
} When to use it
Use it when
- Every section of sypnia.com and the product pages.
- layout split when the words explain something shown beside them: code, a mock, points.
Do not use it when
- Console screens: use Section.
- Two night bands in a row: alternate plain and alt.
For everyone
- It is a section with its title as a heading (h2 by default, level 3 inside another band).
- A night band carries data-surface, so every piece inside it takes night's colours and contrast.
Props
| Band | Type | Default |
|---|---|---|
id | string | |
introMore under the lead: a link, points. | ReactNode | |
kicker | ReactNode | |
layout`split`: the words beside what it shows (stacked on phones). | "split" | "stack" | stack |
lead | ReactNode | |
level | 2 | 3 | 2 |
size | "sm" | "md" | md |
title | ReactNode | |
toneIts ground: `alt` a step deeper, `night` a night band on any surface. | "alt" | "plain" | "night" | plain |