Skip to content

Chip - Web Component

The Chip component can be used imported from:

Playground

Parameters

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

By default, all the parameters are optional or can be set in different, except for the ones marked as required

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

NameTypeDescriptionSlotA11y
contentstringThe text to be displayed in the chip.default
disabledbooleanBlocks the interaction with the component.
readonlybooleanTransforms the chip into an output.

Events

This component has events. Check the documentation about how to use the events.

NamePayloadDescription
clickMouseEventFires when the chip is clicked.

Slots

This component has slots. Check the documentation about how to use the slots.

NameTagsDescription
defaultspanContent of the chip.

Parameters use

content

The text or content inside the chip. It uses the default slot too.

Button

Flags

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

Browser support

Detected engine:  

  • Chromium

  • Webkit

  • Gecko

HTML Examples

CodeSandbox example