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 โ€‹