Skip to content
h v3.13.3
Search the docs
Find a component, section or page.

Tag chip

A label the user wrote: a grey rectangle at the chip radius, an optional mark, and a remove button with a 24px hit area.

Read only With an icon Onboarding Invoices A label long enough to truncate inside its chip

Installation

pnpm add @heyramzi/ui

Usage

import { TagChip } from "@heyramzi/ui/components/chip";

Keyboard and accessibility

Key Does
Space Enter On the remove button, removes the tag.
  • The remove button is named by removeLabel. Name the tag in it, like "Remove design".

API reference

icon Snippet
A leading mark: a tag icon, a colour dot, an avatar.
onRemove () => void
Shows a remove button after the label.
removeLabel string
Default "Remove"
The remove button's accessible name.
removeFocusable boolean
Default true
False keeps the remove button out of the tab order and stops it taking focus on press, for a chip inside a field whose input owns the keyboard (Backspace removes).
children Snippet
class string
...rest
Every prop of HTMLAttributes<HTMLSpanElement> from svelte/elements except children, class
Prop Type Default
icon

A leading mark: a tag icon, a colour dot, an avatar.

Snippet
onRemove

Shows a remove button after the label.

() => void
removeLabel

The remove button's accessible name.

string "Remove"
removeFocusable

False keeps the remove button out of the tab order and stops it taking focus on press, for a chip inside a field whose input owns the keyboard (Backspace removes).

boolean true
children Snippet
class string
...rest Every prop of HTMLAttributes<HTMLSpanElement> from svelte/elements except children, class