Skip to content

Chip โ€‹

Browser support โ€‹

Detected engine: ย 

  • Chromium

  • Webkit

  • Gecko

Parameters โ€‹

The Web component uses the <z-chip> tag:

The parametrization of the component can be done with the following custom HTML params:

NameTypeDescription
content
(optional)
stringThe text to be displayed in the chip.
disabled
(optional)
booleanBlocks the interaction with the component.
readonly
(optional)
booleanTransforms the chip into an output.

The events emitted from the component are:

NamePayloadDescription
onclickMouseEvent

The z-chip receives a click event that can be used to trigger some action when the chip is clicked.

The available slots for the component are:

NameTagsDescription
defaultspan

disabled โ€‹

The attribute disabled will block the interaction with the component

Disabled chip

readonly โ€‹

The attribute readonly will make the component to behave as a readonly component.

Readonly chip

Both background and text color can be customized using the --z-chip--bg and --z-chip--color CSS custom properties respectively.

Custom chip

Also, the hover state can be customized using the --z-chip--bg--hover and --z-chip--color--hover CSS custom properties.

Custom chip

Playground โ€‹

Customization โ€‹

HTML Examples โ€‹

Imports
html
<link rel="stylesheet" href="/0.4.5/@zurich/web-components/styles.css" />
<script type="module" src="/0.4.5/@zurich/web-components/chip.js"></script>
Code
html
<z-chip>Chip</z-chip>
<z-chip disabled>Disabled chip</z-chip>
<z-chip readonly>Readonly chip</z-chip>