Label picker
Several labels at once, each with its colour.
import { LabelPicker } from "@forgeron/ui";Labels
import { LabelPicker } from "@forgeron/ui";
const labels = [
{ value: "bug", label: "Bug", color: "var(--danger)" },
{ value: "feature", label: "Feature", color: "var(--accent)" },
{ value: "improve", label: "Improvement", color: "var(--ink-muted)" },
{ value: "customer", label: "Customer", color: "var(--success)" },
{ value: "ops", label: "Warehouse", color: "var(--warning)" },
];
export default function Default() {
return <LabelPicker labels={labels} defaultValue={["bug", "customer"]} />;
}API → Props
| Prop | Type | Default | Description |
|---|---|---|---|
labels | { value, label, color }[] | — | The labels offered. |
value / defaultValue | string[] | — | Controlled or not. |
onChange | (value: string[]) => void | — | On each tick. |
variant | "chip" | "field" | "chip" | A record's property, or a form control. |
className | string | — | Extra classes. |