sdxc

Type to search, or start from one of these:

Description

A short passage of supporting copy beneath a form control, styled at the library's default text size and the neutral muted foreground color.

Unlimited editors, 100 GB of storage, and a 1-business-day response.

Invoices and renewal notices go here, not to the workspace owner.

View code
let plan = "team";

function choosePlan(event: Event) {
	plan = (event.target as HTMLSelectElement).value;
	void handle.update();
}

<>
	{/* A native select's own change event bubbles, so the field's wrapper is where the
	    island listens; the select stays plain markup. */}
	<div mix={[on<HTMLDivElement, "change">("change", choosePlan)]}>
		<Label htmlFor="plan">Plan</Label>
		<Select id="plan" name="plan" aria-describedby="plan-note">
			{PLANS.map((option) => (
				<Select.Option key={option.id} value={option.id} selected={option.id === plan}>
					{option.label}
				</Select.Option>
			))}
		</Select>
		<Description id="plan-note">{PLAN_NOTES[plan]}</Description>
	</div>

	<Label htmlFor="billingEmail">Billing email</Label>
	<Input
		id="billingEmail"
		name="billingEmail"
		type="email"
		defaultValue="billing@acme.com"
		aria-describedby="billingEmail-note"
	/>
	<Description id="billingEmail-note">
		Invoices and renewal notices go here, not to the workspace owner.
	</Description>
</>

Installation

An ordinary dependency: install it, import the theme once, and import the component where it is used.

npm add @sdxc/ui
import "@sdxc/ui/theme.css";

Usage

import { Description } from "@sdxc/ui";

Renders its children inside a <p> sized and colored as a small run of supporting copy: the library's default text size paired with the neutral muted foreground color, placed after a control inside a field wrapper as a format hint or constraint note.

Props

Read from the component's own types, so every prop, every default and every allowed value is listed.

Also accepts everything in TagProps<"p">.