Header
A small, muted section label rendered inside a native <header> element.
Requests4.2 M
Bandwidth318 GB
Build minutes1,240
Included requests5 M
Overage rate$0.40 / M
View code
let period: keyof typeof USAGE = "current";
function choosePeriod(event: Event) {
period = (event.target as HTMLSelectElement).value as keyof typeof USAGE;
void handle.update();
}
// A native select's change event bubbles, so the panel is where the island listens.
<div mix={[on<HTMLDivElement, "change">("change", choosePeriod)]}>
<Label htmlFor="period">Billing period</Label>
<Select id="period" name="period">
<Select.Option value="current" selected={period === "current"}>This month</Select.Option>
<Select.Option value="previous" selected={period === "previous"}>Last month</Select.Option>
</Select>
<Header>Metered usage</Header>
{USAGE[period].metered.map((row) => (
<div key={row.name} mix={[hstack({ gap: 4, align: "baseline", justify: "between" })]}>
<span>{row.name}</span>
<span>{row.value}</span>
</div>
))}
<Separator />
<Header>Plan limits</Header>
{USAGE[period].limits.map((row) => (
<div key={row.name} mix={[hstack({ gap: 4, align: "baseline", justify: "between" })]}>
<span>{row.name}</span>
<span>{row.value}</span>
</div>
))}
</div>Installation
An ordinary dependency: install it, import the theme once, and import the component where it is used.
npm add @sdxc/uiimport "@sdxc/ui/theme.css";Usage
import { Header } from "@sdxc/ui";Renders its children inside a <header> element styled as a small,
muted, uppercase section label — the heading introducing a group of
related items inside a listbox, menu, or combobox section.
Props
Read from the component's own types, so every prop, every default and every allowed value is listed.
Also accepts everything in TagProps<"header">.