1. Reference
  2. Forms and input

<chip>

A compact chip: a label, a filter that toggles, a single choice in a set, or an action.

Forms and input
chip.ham
<inline-content spacing="8 8">
    <chip variant="choice"
          label="Small"/>
    <chip variant="choice"
          label="Medium"
          selected="true"/>
    <chip variant="choice"
          label="Large"/>
    <chip variant="action"
          label="Add note"
          icon="add"/>
</inline-content>
The snippet drawn by Hype Apps on a phone, in light mode The snippet drawn by Hype Apps on a phone, in dark mode
This snippet as Hype Apps draws it on a phone. It follows this page's light or dark theme.

Attributes

NameWhat it doesDefault
color Color
color
icon Icon name
string
label Chip text
string
name Choice chips sharing a name are one choice (default: the choice chips side by side)
string
selected Initially selected (filter/choice variants)
boolean
false
variant Chip style variant
filled, outlined, filter, choice, action
filled

Readings

NameWhat it does
selected Whether the chip is selected (filter and choice chips).

Any tag also takes gestures: @on.tap, @on.longpress, @on.doubletap and @on.swipeleft (and right, up and down). @click runs on a tap too.

Guides and recipes that use it

This page is also Markdown, and all of HAM is in llms.txt.