Skip to content

Chip โ€‹

A small status or label chip. Slot any content inside โ€” text, count, icon. Toggle Vue / CSS to switch the live demo and source together.

The look is Basecoat's .badge (see Theme): a h-5 rounded-4xl pill with px-2, text-xs and font-medium, in three variants โ€” soft (the tonal bg-c/10 text-c badge, and mono's default), solid (bg-c text-c-foreground) and outline. Dark mode is built in: the tonal fill deepens through --mono-mode-tint.

Basic โ€‹

Five color variants with the default soft style.

Vue SFC

Sizes โ€‹

xs, sm, md, lg, xl, xxl.

Vue SFC

Colors โ€‹

Pick a colour and every variant takes it. Soft is a tinted surface in the colour, solid fills with it, outline keeps a bare border and inks the text.

Vue SFC

Rounded โ€‹

The same corner scale every mono control uses: none, xsโ€ฆxxl, full. Unset keeps the pill a chip has by default.

Vue SFC

Dot โ€‹

Status dot indicator next to the label.

Vue SFC

Icon โ€‹

Slot an icon on the left or right of the label.

Vue SFC

Interactive โ€‹

Clickable, selected, disabled and removable states.

Vue SFC

Renders as <a> when href is set.

Vue SFC

Event: click โ€‹

Listen for the click event on a clickable chip.

Vue SFC

Event: toggle โ€‹

Two-way binding to a clickable chip's selected state.

Vue SFC

Event: remove โ€‹

Remove items from a list when their close button fires close.

Vue SFC

Event: group โ€‹

Multi-select chip group; clicks toggle each chip.

Vue SFC

Event log โ€‹

Live log of click and close events.

Vue SFC

Customized โ€‹

Override per-element styling with the cssClass prop (Vue) or extra utility classes (CSS).

Put box utilities on main, not root. The root is a layout wrapper that paints nothing โ€” it exists so a field can lay chips out โ€” and the badge itself is main: the fill, the border, the corner and the padding all live there. A rounded-* / shadow-* / px-* utility handed to root lands on the wrapper and is invisible. The corner has a prop of its own (rounded), which is what the box actually reads.

Vue SFC

CSS Variables โ€‹

Vue SFC

Every chip is themed through --mono-chip-* custom properties. Setting one on the element, on any wrapper/ancestor, or inline all work โ€” custom properties inherit, and they pierce the shadow-DOM boundary, so the same overrides apply to <mono-chip> and the shadow build. Override a role (e.g. --mono-chip-primary) and every variant derives from it. To re-skin globally, set the underlying tokens (--primary, --destructive, --secondary โ€ฆ) โ€” or switch flavor.

The three variants own separate paint knobs, so restyling one never repaints the others; the un-scoped --mono-chip-bg / -color / -border-color are the blanket override that does.

VariableDefaultControls
--mono-chip-<role> / -<role>-foreground--primary, --destructive, โ€ฆThe ten colour roles (primary secondary success danger warning info teal purple neutral dark)
--mono-chip-soft-bg / -soft-color / -soft-border-colorrole/10 (dark /20) / role / transparentThe soft (default) badge
--mono-chip-solid-bg / -solid-color / -solid-border-colorrole / role-foreground / transparentThe solid badge
--mono-chip-outline-bg / -outline-color / -outline-border-colortransparent / role / roleThe outline badge
--mono-chip-bg / -color / -border-colorโ€”Blanket overrides, above all three variants
--mono-chip-height-<size> / -padding-x-<size> / -gap-<size> / -font-size-<size> / -glyph-size-<size>5 ร— / 2 ร— / 1 ร— --mono-spacing, --mono-text-xs, 3 ร— --mono-spacing at mdThe size ladder, per step
--mono-chip-height / -padding-x / -gap / -font-size / -glyph-sizeโ€”The same five, for EVERY size at once (a consumer override โ€” a flavor should write the per-size twin)
--mono-chip-radius--mono-radius-4xlCorner (the rounded prop writes the preset tier below it)
--mono-chip-border-width / -font-weight / -letter-spacing / -text-transform--mono-border-width / medium / normal / noneThe badge's edge and type
--mono-chip-dot-size1.5 ร— --mono-spacingThe leading status dot
--mono-chip-remove-* โ†’ see mono-closeโ€”The โœ• is sized by -glyph-size-<size>
--mono-chip-ring-color / -ring-width / -ring-alpha--ring / --mono-ring-width / --mono-ring-alphaFocus and selected rings
--mono-status-dot-color / -size / -gap / -font-size / -font-weightper state / 2 ร— --mono-spacing / โ€ฆThe standalone <mono-status-dot>

Deprecated and honoured as no-ops until 2.0: --mono-chip-<role>-soft and --mono-chip-<role>-lite (the old per-role fill and border tints โ€” use the variant knobs above, or color-mix), and --status-custom-color (now --mono-status-dot-color).

Types โ€‹

Importimport { MonoChipProps } from 'mono-helper'
PropValueDefaultDescription
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'โ€”Sizing scale of the chip.
color'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'teal' | 'purple' | 'neutral' | 'dark'โ€”Color theme applied to the chip.
variant'outline' | 'solid' | 'soft'โ€”Visual style: soft, solid, or outline.
rounded'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | 'none' | 'full'โ€”Corner style: pill, rounded, or square.
labelstringโ€”Text content shown inside the chip.
dotbooleanโ€”Shows a status dot before the label.
removablebooleanโ€”Adds a close button to remove the chip.
disabledbooleanโ€”Disables interaction and dims the chip.
clickablebooleanโ€”Makes the chip clickable and toggleable.
modelValuebooleanโ€”Two-way bound selected state of the chip.
selectedbooleanโ€”Whether the chip is in the selected state.
hrefstringโ€”Renders the chip as a link to this URL.
targetstringโ€”Link target when an href is set.
iconPosition'left' | 'right'โ€”Recommended JS/TS prop.
ariaLabelTextstringโ€”Recommended JS/TS prop.
ariaLabelstringโ€”Shorter alias.
closeLabelstringโ€”Recommended JS/TS prop.
cssClassChipCssClassโ€”Per-element class overrides for internal parts.