A wider screen, please

This page features interactive demos and side-by-side code samples that need at least 340 pixels of horizontal space. Please widen your browser window, or rotate your device, to continue.

Morpheus v0.1.0
v0.1.0

Badge#

Component <neo-badge> is a small inline label / chip for status, counts, tags, and category markers. Variants reuse the button colour tokens so theme swaps carry badges along.

Default
Variants
With icon
With status dot
As link
Counts
Deactivate Rename Duplicate
Delete
New state Toggle autoplay
New
HTML CSS

The selected state's markup and its scoped CSS. The CSS is wrapped in <style>@scope { ... }</style> and applies to the preview only. Edits change the preview above, applied live while Sync is on, or when you click Patch or Replace. Patch morphs the preview; Replace swaps it outright.

Replace Patch

Signals

Datastar signals declared in the selected state's markup. Change a value to drive the preview, applied live while Sync is on, or when you click Patch.

Patch

Reference#

Attributes #

NameTypeDefaultDescription
variant"primary" | "secondary" | "danger" | "outline"noneVisual style. Omit for the default neutral chip.

CSS variables #

NameDefaultDescription
--neo-badge-padding-y0.125remVertical padding.
--neo-badge-padding-x0.5remHorizontal padding.
--neo-badge-radius9999pxCorner radius. Default fully rounds the chip into a pill.
--neo-badge-font-size0.75remLabel font size.
--neo-badge-font-weight600Label font weight.
--neo-badge-gap0.25remGap between an icon and the label.
--neo-badge-border-colorcolor-mix(in srgb, var(--page-fg) 14%, transparent)Border color of the default and outline chips.
--neo-badge-bgcolor-mix(in srgb, var(--page-fg) 6%, transparent)Background of the default chip.
--neo-badge-colorvar(--page-fg)Text color of the default chip.

Examples#

Variants#

Five fills tied to the button colour tokens: default (neutral), primary, secondary, danger, and outline (transparent with a border).

DefaultPrimarySecondaryDangerOutline

With icon#

Drop a <neo-icon> as the badge's first child. The flex layout spaces it from the label, and it inherits the badge's font colour, so the icon recolours with the variant.

Saved Pro Failed Info Beta

With status dot#

A small inline <span> with a round background makes a status-indicator badge. A modifier class sets the dot colour per status.

Online Idle Error Offline

Wrap the badge in an <a>. It is display: inline-flex, so it nests inside inline anchors and picks up the link's hover and focus from the cascade.

Documentation Changelog

Counts#

Short numeric badges next to a label: the unread-count pattern. line-height: 1 keeps them from stretching the row at small font sizes.

Inbox12 Mentions3 Drafts42 Archive128

The badge sits on the text baseline, so it reads as part of a sentence without pushing surrounding lines apart. New tags roll out weekly and the experimental ones ship behind a beta flag.

Settings

Theme

Default Sunshine Ocean Matrix Rose

Accessibility

Playgrounds

Server Simulator