Server shell + client leaf

Tag

Chips for labels and filters: closable, checkable, and groupable.

Astralisv0.1DesignEngineeringResearch

Import#

import { Tag } from "astralis-ui";
// Tag.Checkable, Tag.Group

Tag or Badge?#

Tag is a label the thing carries (a topic, a category, a filter, a selected value), which is why it can be removed, selected and grouped. If you're describing a state the thing is in (Active, Beta, 3 unread), that's Badge. The two chips look nearly identical, so the component name is what tells a reader which you meant.

Checkable groups#

Tag.Checkable is a chip with checkbox semantics; Tag.Group manages a whole set from an options array: multiple for filters, single-select for exclusive choices.

ReactVueSvelteSolid

Following: react

Props#

PropTypeDefaultDescription
variant"solid" | "subtle" | "surface" | "outline""subtle"Same family as Button/Badge.
size"xs" | "sm" | "md" | "lg""md"Chip size (same scale as Badge).
colorSchemeall 15 schemes"gray"Hue.
startElement / endElementReactNodeNoneLeading / trailing slots (endElement yields to the close button).
closable / onCloseboolean / () => voidNoneAdds the ✕ remove button.

Tag.Checkable#

Takes Tag's props except variant, closable and onClose, plus:

PropTypeDefaultDescription
checked / onChangeboolean / (checked: boolean) => voidNoneSelected state and its change callback.
colorSchemeall 15 schemes"brand"Hue used while checked.

Tag.Group#

PropTypeDefaultDescription
options{ label, value }[] | (string | number)[]NoneThe chips to render. Required.
value / onChange(string | number)[] / (value) => voidNoneThe selected values and their change callback. The group is always controlled, so pass both.
multiplebooleanfalseAllow several selected at once. Otherwise selecting one clears the rest.
size"xs" | "sm" | "md" | "lg""md"Size of every chip.
colorSchemeall 15 schemes"brand"Checked hue of every chip.

Keyboard#

Every checkable tag is its own tab stop.

KeyAction
Tab / Shift+TabMove to the next / previous tag
Enter / SpaceToggle the focused tag

On a closable tag, the remove button is a separate tab stop and activates with Enter or Space.

Accessibility#

Checkable tags carry role="checkbox" + aria-checked and toggle with Enter/Space; the close button is labeled "Remove".