smrt
Open the smrt source on GitHub Switch to dark color scheme
← All UI components

Actions and display

Chip

Compact token, optionally selectable (toggle) and/or closeable.

Public export

typescript
import { Chip } from '@happyvertical/smrt-ui/ui';
Import path
@happyvertical/smrt-ui/ui
Props
9
Props described
9 of 9
Bindable state
0
Callback events
2
Verified release
0.62.10

Props

NameTypeRequiredDescription
labelstringNoText label; also the close button's accessible name (`Remove <label>`).
childrenSnippetNoChip content; falls back to `label`.
selectablebooleanNoRender the body as a toggle button reflecting `selected`.
selectedbooleanNoSelected state (only meaningful with `selectable`).
closeablebooleanNoAppend a remove (×) button.
disabledbooleanNoDisable both buttons.
sizeChipSizeNoSize variant.
onselect() => voidNoFired when a selectable chip body is activated.
onclose() => voidNoFired when the remove button is activated.

Bindable state

This component has no bindable public state.

Callback events

  • onselect() => void
  • onclose() => void

Examples and explanation