IconChip

IconChip

HkIconChip is the standard leading icon chip: a small rounded square painted in a 12% tint of a tone colour, with that same tone as the glyph ink. It is the anatomy that used to be copy-pasted as inline styles across roster rows, card headers and stat strips — now one component, one palette. The chip is purely decorative by contract: its root is aria-hidden="true", so the meaning of the glyph must be carried by the text beside it.

  • The tone palette is the one the stat card owns (primary / info / success / warning / error / muted), so a chip inside a stat card always matches that card's own health colour.
  • When the glyph is the action, the control is an HkIconButton; a chip never takes focus and never fires an event.
  • A glyph that needs its own accessible name belongs in a labelled control, not in the chip: the chip is skipped by assistive technology on purpose.

Import

tsx
1
import { HkIconChip } from "@celestia-island/hikari";
rust
1
2
use hikari_components::*;          // IconChip, IconChipTone, IconChipSize
use hikari_components::prelude::*; // rsx!, VNode, Icon, MdiIcon

Tones

Six tones, primary by default. The tone drives both channels at once: the background is a 12% wash of the tone colour and the glyph is painted in that colour, so a chip never reads as a grey box with a coloured mark. The Vue icon prop takes a component (a lucide export); the Rust prop is a typed MdiIcon.

Sizes

Two box steps: md (the default) is a 28px square with a 15px glyph, and sm is a 24px square with a 13px glyph — the step that fits inside a dense table row. The glyph is scaled by the component, not the caller, so the two steps stay in proportion.

Small chips sit on the same baseline as a dense row's text.

API

Vue

Props

NameTypeDefaultRequired
icon[Object, Function] as PropType<Component>—✓
toneString as PropType<StatTone>"primary"—
size<code>String as PropType<"sm" | "md"></code>"md"—

Rust

Props — IconChip

PropTypeDefaultDescription
iconMdiIconMdiIcon::HelpThe glyph (Rust: a typed MDI icon — Vue passes a component).
toneIconChipToneIconChipTone::Primary—
sizeIconChipSizeIconChipSize::Md—

Accessibility

  • The chip's root carries aria-hidden="true", so the glyph never reaches the accessibility tree as a nameless image. The text beside it — the row title, the card label — is what names the thing.
  • Nothing inside the chip is focusable and the chip emits no events, so it adds no stop to the Tab order and never steals a click from its row.
  • A tone is a colour channel only: it encodes no text for assistive technology. When a state must be announced, put the words in the adjacent text, not in the chip's ink.

Related components

  • HkIconButton — the clickable counterpart when the glyph itself is the action.
  • HkStatusRow — the row that mounts a chip in its leading slot and shades it with the row's own tone.
  • HkStatusPill — the compact health readout, when the state needs a dot and words rather than an icon.