OTTODesign System

Components

Chip

A chip is used for selecting or filtering and always occurs in a set of multiple chips.

Configurator

LiveChip: size, icons, colour surface, width and selection
HTML
<oc-chip-v3><input type="checkbox" aria-label="oc-auto"><label slot="content">Nachhaltig</label></oc-chip-v3>

Usage

Anatomy

1 2 3 4
  1. Icon or image left (optional)
  2. Label
  3. Icon right (optional)
  4. Container
LiveAnnotations
HTML
<div class="anatomy" style="margin:40px 56px">
<span style="display:inline-block;zoom:1.6"><oc-chip-v3 icon-left="sparkles" icon-right="close"><button aria-label="Neu entfernen">Neu</button></oc-chip-v3></span>
<span class="anatomy-pin" style="left:14%;top:-18%">1</span>
<span class="anatomy-pin" style="left:50%;top:-18%">2</span>
<span class="anatomy-pin" style="left:86%;top:-18%">3</span>
<span class="anatomy-pin" style="left:100%;top:100%">4</span>
<ol class="anatomy-key"><li data-n="1">Icon or image left (optional)</li><li data-n="2">Label</li><li data-n="3">Icon right (optional)</li><li data-n="4">Container</li></ol>

Variants

The chip component can contain different types of content like text, icon or image. On the left side, you can place an icon or image, and on the right side, you can only place icons. The chip is available in two different sizes (chip 100 & chip 200).

The default variant should be used on canvas background. The on-color variant should be used on frame background.

Label only

Icon and label

Image and label

Farbe Blau.
LiveText chip, icon chip and image chip
HTML
<div class="on-frame" style="margin:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px">
<div style="background:var(--oc-semantic-color-background-canvas, #fff);padding:32px 16px;display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center"><p class="demo-label" style="width:100%;text-align:center">Label only</p><oc-chip-v3><input type="checkbox" aria-label="oc-auto"><label slot="content">Damen</label></oc-chip-v3></div>
<div style="background:var(--oc-semantic-color-background-canvas, #fff);padding:32px 16px;display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center"><p class="demo-label" style="width:100%;text-align:center">Icon and label</p><oc-chip-v3 icon-left="sparkles"><input type="checkbox" aria-label="oc-auto"><label slot="content">Neu</label></oc-chip-v3></div>
<div style="background:var(--oc-semantic-color-background-canvas, #fff);padding:32px 16px;display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center"><p class="demo-label" style="width:100%;text-align:center">Image and label</p><oc-chip-v3><img slot="image" src="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27%3E%3Ccircle cx=%2712%27 cy=%2712%27 r=%2712%27 fill=%27%232b6cd6%27/%3E%3C/svg%3E" alt="Farbe Blau." style="max-width:none;margin-top:0;margin-bottom:0"><input type="checkbox" aria-label="oc-auto"><label slot="content">Blau</label></oc-chip-v3></div>

On the canvas: size 100 and 200

On a coloured surface: over-color

LiveDefault chip100 & chip200, inverted chip100 & chip200
HTML
<div class="on-frame" style="margin:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px">
<div style="background:var(--oc-semantic-color-background-canvas, #fff);padding:32px 16px;display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center"><p class="demo-label" style="width:100%;text-align:center">On the canvas: size 100 and 200</p><oc-chip-v3 size="100" icon-left="sparkles"><input type="checkbox" aria-label="oc-auto"><label slot="content">Neu</label></oc-chip-v3><oc-chip-v3 size="200" icon-left="sparkles"><input type="checkbox" aria-label="oc-auto"><label slot="content">Neu</label></oc-chip-v3></div>
<div style="padding:32px 16px;display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center"><p class="demo-label" style="width:100%;text-align:center">On a coloured surface: over-color</p><oc-chip-v3 size="100" over-color icon-left="sparkles"><input type="checkbox" aria-label="oc-auto"><label slot="content">Neu</label></oc-chip-v3><oc-chip-v3 size="200" over-color icon-left="sparkles"><input type="checkbox" aria-label="oc-auto"><label slot="content">Neu</label></oc-chip-v3></div>

The chip can have the following additional attributes:

  • Removable: Displays a "close" affordance icon on the right and forces the chip to be removed on click/tap.
  • Checked: Adds a checked state to the chip that can optionally be extended with the "check" icon as the icon on the left. The "check" icon overrides the current icon or image.
  • Disabled: Disables the chip.

Removable

Selected with check mark

Disabled

LiveRemovable chip, checked chip and disabled chip
HTML
<div class="on-frame" style="margin:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px">
<div style="background:var(--oc-semantic-color-background-canvas, #fff);padding:32px 16px;display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center"><p class="demo-label" style="width:100%;text-align:center">Removable</p><oc-chip-v3 icon-right="close"><button aria-label="Blau entfernen">Blau</button></oc-chip-v3></div>
<div style="background:var(--oc-semantic-color-background-canvas, #fff);padding:32px 16px;display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center"><p class="demo-label" style="width:100%;text-align:center">Selected with check mark</p><oc-chip-v3 use-check-state-icon><input type="checkbox" checked aria-label="oc-auto"><label slot="content">Nachhaltig</label></oc-chip-v3></div>
<div style="background:var(--oc-semantic-color-background-canvas, #fff);padding:32px 16px;display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center"><p class="demo-label" style="width:100%;text-align:center">Disabled</p><oc-chip-v3><input type="checkbox" disabled aria-label="oc-auto"><label slot="content">Ausverkauft</label></oc-chip-v3></div>

Behavior

States

Default: hover, press and tab to it

Over colour: hover, press and tab to it

Selected: hover, press and tab to it

LiveStates
HTML
<div class="on-frame" style="margin:0;display:grid;gap:8px">
<div style="background:var(--oc-semantic-color-background-canvas, #fff);padding:32px 16px;display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center"><p class="demo-label" style="width:100%;text-align:center">Default: hover, press and tab to it</p><oc-chip-v3 icon-right="close" icon-left="smiley-positive"><button aria-label="Blau entfernen">Blau</button></oc-chip-v3></div>
<div style="padding:32px 16px;display:flex;flex-wrap:wrap;gap:8px;justify-content:center"><p class="demo-label" style="width:100%;text-align:center">Over colour: hover, press and tab to it</p><oc-chip-v3 icon-right="close" over-color icon-left="smiley-positive"><button aria-label="Blau entfernen">Blau</button></oc-chip-v3></div>
<div style="background:var(--oc-semantic-color-background-canvas, #fff);padding:32px 16px;display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center"><p class="demo-label" style="width:100%;text-align:center">Selected: hover, press and tab to it</p><oc-chip-v3 icon-left="smiley-positive"><input type="checkbox" checked aria-label="oc-auto"><label slot="content">Blau</label></oc-chip-v3></div>

Fitting

The width of the chip fits its content, meanwhile the height of the chip remains fixed. The chip is also available as fill-parent with centered text. The chip also supports multiline text that is left-aligned.

Width fits the content; height 2 rem (size 100) and 3 rem (size 200)

LiveFitting of chip100 and chip200
HTML
<div class="on-frame" style="margin:0;display:grid;grid-template-columns:repeat(1,minmax(0,1fr));gap:8px">
<div style="background:var(--oc-semantic-color-background-canvas, #fff);padding:32px 16px;display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center"><p class="demo-label" style="width:100%;text-align:center">Width fits the content; height 2 rem (size 100) and 3 rem (size 200)</p><oc-chip-v3 icon-right="close" size="100" icon-left="smiley-positive"><button aria-label="Blau entfernen">Blau</button></oc-chip-v3><oc-chip-v3 icon-right="close" size="200" icon-left="smiley-positive"><button aria-label="Blau entfernen">Blau</button></oc-chip-v3></div>

fill-parent

fill-parent, height fits the content

LiveFill-parent and multi-line
HTML
<div class="on-frame" style="margin:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px">
<div style="background:var(--oc-semantic-color-background-canvas, #fff);padding:32px 24px;display:flex;flex-direction:column;gap:8px"><p class="demo-label" style="width:100%;text-align:center">fill-parent</p><oc-chip-v3 width-behavior="fill"><input type="checkbox" aria-label="oc-auto"><label slot="content">Das ist ein Standard-Chip</label></oc-chip-v3></div>
<div style="background:var(--oc-semantic-color-background-canvas, #fff);padding:32px 24px;display:flex;flex-direction:column;gap:16px"><p class="demo-label" style="width:100%;text-align:center">fill-parent, height fits the content</p><oc-chip-v3 width-behavior="fill"><input type="checkbox" aria-label="oc-auto"><label slot="content">Das ist ein Standard-Chip<br>mit zwei Zeilen</label></oc-chip-v3><oc-chip-v3 width-behavior="fill" icon-left="smiley-positive" icon-right="close"><button>Das ist ein Chip mit noch mehr Zeilen, genau genommen drei. Rechts ist auch Platz für ein Icon.</button></oc-chip-v3></div>

Placement

When placing multiple chips horizontal or vertical to each other, make sure there is a gap of 8px in-between. Chips can be arranged either horizontally next to each other, extending beyond the viewport in a scrollable cinema, or they can stay within the viewport by wrapping below each other.

Wrapping: 8 px gaps

In a cinema: one scrollable row

LiveHorizontal and vertical placing
HTML
<div class="on-frame" style="margin:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px">
<div style="background:var(--oc-semantic-color-background-canvas, #fff);padding:32px 16px;display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center;justify-content:flex-start"><p class="demo-label" style="width:100%;text-align:center">Wrapping: 8 px gaps</p><oc-chip-v3 icon-left="smiley-positive"><input type="checkbox" aria-label="oc-auto"><label slot="content">Damen</label></oc-chip-v3><oc-chip-v3 icon-left="smiley-positive"><input type="checkbox" aria-label="oc-auto"><label slot="content">Herren</label></oc-chip-v3><oc-chip-v3 icon-left="smiley-positive"><input type="checkbox" aria-label="oc-auto"><label slot="content">Kinder</label></oc-chip-v3><oc-chip-v3 icon-left="smiley-positive"><input type="checkbox" aria-label="oc-auto"><label slot="content">Baby</label></oc-chip-v3><oc-chip-v3 icon-left="smiley-positive"><input type="checkbox" aria-label="oc-auto"><label slot="content">Sport</label></oc-chip-v3><oc-chip-v3 icon-left="smiley-positive"><input type="checkbox" aria-label="oc-auto"><label slot="content">Schuhe</label></oc-chip-v3><oc-chip-v3 icon-left="smiley-positive"><input type="checkbox" aria-label="oc-auto"><label slot="content">Wäsche</label></oc-chip-v3></div>
<div style="background:var(--oc-semantic-color-background-canvas, #fff);padding:32px 16px;min-width:0"><p class="demo-label" style="width:100%;text-align:center">In a cinema: one scrollable row</p><oc-cinema-v1 oc-aria-label="Kategorien" resizing="none"><oc-chip-v3 icon-left="smiley-positive"><input type="checkbox" aria-label="oc-auto"><label slot="content">Damen</label></oc-chip-v3><oc-chip-v3 icon-left="smiley-positive"><input type="checkbox" aria-label="oc-auto"><label slot="content">Herren</label></oc-chip-v3><oc-chip-v3 icon-left="smiley-positive"><input type="checkbox" aria-label="oc-auto"><label slot="content">Kinder</label></oc-chip-v3><oc-chip-v3 icon-left="smiley-positive"><input type="checkbox" aria-label="oc-auto"><label slot="content">Baby</label></oc-chip-v3><oc-chip-v3 icon-left="smiley-positive"><input type="checkbox" aria-label="oc-auto"><label slot="content">Sport</label></oc-chip-v3><oc-chip-v3 icon-left="smiley-positive"><input type="checkbox" aria-label="oc-auto"><label slot="content">Schuhe</label></oc-chip-v3><oc-chip-v3 icon-left="smiley-positive"><input type="checkbox" aria-label="oc-auto"><label slot="content">Wäsche</label></oc-chip-v3></oc-cinema-v1></div>

Selection modes

Chips can operate in two different modes: single-selection or multi-selection.

In single-selection mode, choosing one option automatically deselects any previously selected options - serving as radio buttons.

In multi-selection mode, multiple chips can be selected at the same time, allowing users to choose several options without deselecting any of the previously selected ones - serving as checkboxes.

There are no further signifiers to distinguish the two selection modes.

Single select (radio)

Multi select (checkbox) with check mark

LiveSingle select and multi select
HTML
<div class="on-frame" style="margin:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px">
<div style="background:var(--oc-semantic-color-background-canvas, #fff);padding:32px 16px;display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center"><p class="demo-label" style="width:100%;text-align:center">Single select (radio)</p><oc-chip-v3 icon-left="smiley-positive"><input type="radio" name="chip-single" aria-label="oc-auto"><label slot="content">Relevanz</label></oc-chip-v3><oc-chip-v3 icon-left="smiley-positive"><input type="radio" name="chip-single" checked aria-label="oc-auto"><label slot="content">Preis</label></oc-chip-v3><oc-chip-v3 icon-left="smiley-positive"><input type="radio" name="chip-single" aria-label="oc-auto"><label slot="content">Neuheiten</label></oc-chip-v3><oc-chip-v3 icon-left="smiley-positive"><input type="radio" name="chip-single" aria-label="oc-auto"><label slot="content">Bewertung</label></oc-chip-v3></div>
<div style="background:var(--oc-semantic-color-background-canvas, #fff);padding:32px 16px;display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center"><p class="demo-label" style="width:100%;text-align:center">Multi select (checkbox) with check mark</p><oc-chip-v3 icon-left="smiley-positive" use-check-state-icon><input type="checkbox" checked aria-label="oc-auto"><label slot="content">Schwarz</label></oc-chip-v3><oc-chip-v3 icon-left="smiley-positive" use-check-state-icon><input type="checkbox" checked aria-label="oc-auto"><label slot="content">Weiß</label></oc-chip-v3><oc-chip-v3 icon-left="smiley-positive" use-check-state-icon><input type="checkbox" aria-label="oc-auto"><label slot="content">Rot</label></oc-chip-v3><oc-chip-v3 icon-left="smiley-positive" use-check-state-icon><input type="checkbox" checked aria-label="oc-auto"><label slot="content">Blau</label></oc-chip-v3></div>

Chips vs. buttons

Interacting with a chip keeps users in the current step of their journey, for example when filtering or sorting. Meanwhile, interacting with a button takes users to the next or previous step in their journey. Buttons are used to perform actions such as Submit, Delete, or Confirm.

Chips should preferably be used in sets of more than 3. In comparison, buttons should be used as little as possible, ideally no more than 3 within the feature.

Größe wählen

Chips: choose an option

Bestellung

Weiter zur KasseZurück zum Warenkorb

Buttons: trigger an action

LiveDifference between Chips and Buttons
HTML
<div class="on-frame" style="margin:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px">
<div style="background:var(--oc-semantic-color-background-canvas, #fff);padding:24px;display:flex;flex-direction:column;gap:16px;border-radius:24px 24px 0 0"><p class="demo-title">Größe wählen</p><div style="display:flex;flex-wrap:wrap;gap:8px"><oc-chip-v3><input type="radio" name="chip-vs-button" checked aria-label="oc-auto"><label slot="content">36</label></oc-chip-v3><oc-chip-v3><input type="radio" name="chip-vs-button" aria-label="oc-auto"><label slot="content">38</label></oc-chip-v3><oc-chip-v3><input type="radio" name="chip-vs-button" aria-label="oc-auto"><label slot="content">40</label></oc-chip-v3><oc-chip-v3><input type="radio" name="chip-vs-button" aria-label="oc-auto"><label slot="content">42</label></oc-chip-v3><oc-chip-v3><input type="radio" name="chip-vs-button" aria-label="oc-auto"><label slot="content">44</label></oc-chip-v3><oc-chip-v3><input type="radio" name="chip-vs-button" aria-label="oc-auto"><label slot="content">46</label></oc-chip-v3></div><p class="demo-label">Chips: choose an option</p></div>
<div style="background:var(--oc-semantic-color-background-canvas, #fff);padding:24px;display:flex;flex-direction:column;gap:12px"><p class="demo-title">Bestellung</p><oc-button-v1 variant="primary" icon-type-right="arrow-right">Weiter zur Kasse</oc-button-v1><oc-button-v1 variant="secondary" icon-type-right="arrow-right">Zurück zum Warenkorb</oc-button-v1><p class="demo-label">Buttons: trigger an action</p></div>

Best practices

DoUse in groups of more than 3.
Don'tUse only one chip.
DoOnly use the same chip size in the same feature.
Don'tMix chips sizes in the same feature.
DoMake the width of the chip fit its content (fit-content).
CautionMake the width of the chip larger than its content (e.g. fill-parent). Make width of the chip smaller than its content so that it gets truncated.
DoOnly use removable or non removable chips within the same feature.
Don'tMix removable chip with non removable chips.
DoUse Tabs for navigation.
CautionUse Chips for navigating.

Content guidelines

Do
  1. Keep the label of the chip shorter than 3 words.
  2. Use adjectives or nouns for the label.
Don't
  1. Use long sentences with 3 or more words, including puncuation.
  2. Use verbs for the label.

Accessibility

Implementation

Live demo

Neuheiten

3 Artikel
Sessel „Ilvy“ aus Bouclé, Eiche natur
Neu

andas

Sessel „Ilvy“ aus Bouclé, Eiche natur

399,99 €

Sneaker aus Glattleder, Weiß
-20 %

OTTO products

Sneaker aus Glattleder, Weiß

99,99 € 79,99 €

Over-Ear-Kopfhörer mit Noise Cancelling

Hanseatic

Over-Ear-Kopfhörer mit Noise Cancelling

59,99 €

LiveReal OTTO components, rendered by the OTTO component runtime
HTML
<div style="display:flex;align-items:baseline;gap:8px;flex-wrap:wrap"><p class="demo-title" style="font-size:1.25rem">Neuheiten</p><span class="demo-copy" style="color:var(--oc-semantic-color-text-secondary, #6d6d6d)">3 Artikel</span></div>
<oc-chip-v3><input type="radio" name="chip-demo-cat" checked aria-label="oc-auto"><label slot="content">Alle</label></oc-chip-v3><oc-chip-v3><input type="radio" name="chip-demo-cat" aria-label="oc-auto"><label slot="content">Möbel</label></oc-chip-v3><oc-chip-v3><input type="radio" name="chip-demo-cat" aria-label="oc-auto"><label slot="content">Schuhe</label></oc-chip-v3><oc-chip-v3><input type="radio" name="chip-demo-cat" aria-label="oc-auto"><label slot="content">Elektronik</label></oc-chip-v3><oc-chip-v3><input type="radio" name="chip-demo-cat" aria-label="oc-auto"><label slot="content">Wohnaccessoires</label></oc-chip-v3></div>
<oc-chip-v3 icon-left="filter" size="100"><button>Filter</button></oc-chip-v3><oc-chip-v3 icon-right="close" size="100"><button aria-label="Filter Nachhaltig entfernen">Nachhaltig</button></oc-chip-v3><oc-chip-v3 icon-right="close" size="100"><button aria-label="Filter Bis 400 € entfernen">Bis 400 €</button></oc-chip-v3></div>
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(9.5rem,1fr));gap:24px 16px"><article style="display:flex;flex-direction:column;gap:2px;min-width:0"><div style="position:relative;border-radius:16px;overflow:hidden;background:#f3f3f3"><img src="/previews/imagery/samples/otto-product-still/product-armchair.webp" alt="Sessel „Ilvy“ aus Bouclé, Eiche natur" width="600" height="600" loading="lazy" style="display:block;width:100%;height:auto;margin:0;mix-blend-mode:multiply"><div style="position:absolute;left:12px;bottom:12px;display:flex;gap:4px;flex-wrap:wrap"><oc-tag-v1 variant="info-primary" size="50">Neu</oc-tag-v1></div></div><p class="demo-copy" style="margin-top:10px;color:var(--oc-semantic-color-text-secondary, #6d6d6d);text-transform:uppercase;font-size:0.75rem;letter-spacing:0.02em">andas</p><p class="demo-copy">Sessel „Ilvy“ aus Bouclé, Eiche natur</p><p class="demo-copy" style="margin-top:6px"><strong style="font-size:1rem">399,99 €</strong></p></article><article style="display:flex;flex-direction:column;gap:2px;min-width:0"><div style="position:relative;border-radius:16px;overflow:hidden;background:#f3f3f3"><img src="/previews/imagery/samples/otto-product-still/product-sneaker.webp" alt="Sneaker aus Glattleder, Weiß" width="600" height="600" loading="lazy" style="display:block;width:100%;height:auto;margin:0;mix-blend-mode:multiply"><div style="position:absolute;left:12px;bottom:12px;display:flex;gap:4px;flex-wrap:wrap"><oc-tag-v1 variant="sale" size="50">-20 %</oc-tag-v1></div></div><p class="demo-copy" style="margin-top:10px;color:var(--oc-semantic-color-text-secondary, #6d6d6d);text-transform:uppercase;font-size:0.75rem;letter-spacing:0.02em">OTTO products</p><p class="demo-copy">Sneaker aus Glattleder, Weiß</p><p class="demo-copy" style="margin-top:6px"><s style="color:var(--oc-semantic-color-text-secondary, #6d6d6d)">99,99 €</s> <strong style="color:var(--oc-semantic-color-text-sale, #e20020);font-size:1rem">79,99 €</strong></p></article><article style="display:flex;flex-direction:column;gap:2px;min-width:0"><div style="position:relative;border-radius:16px;overflow:hidden;background:#f3f3f3"><img src="/previews/imagery/samples/otto-product-still/product-headphones.webp" alt="Over-Ear-Kopfhörer mit Noise Cancelling" width="600" height="600" loading="lazy" style="display:block;width:100%;height:auto;margin:0;mix-blend-mode:multiply"></div><p class="demo-copy" style="margin-top:10px;color:var(--oc-semantic-color-text-secondary, #6d6d6d);text-transform:uppercase;font-size:0.75rem;letter-spacing:0.02em">Hanseatic</p><p class="demo-copy">Over-Ear-Kopfhörer mit Noise Cancelling</p><p class="demo-copy" style="margin-top:6px"><strong style="font-size:1rem">59,99 €</strong></p></article></div>

Code

Version Tag Status API
v3 <oc-chip-v3> Stable ChipV3
v2 <oc-chip-v2> Deprecated ChipV2

API

API: <oc-chip-v3> (ChipV3)

The chip component represents complex entities in compact form, such as tags or selected options. It offers interactive features like removal and disabling, and allows visual customization with inverted backgrounds, icons, and adjustable sizes.

Attributes / properties
Attribute Type Default Required Description
size "100" | "200" undefined no Sets the size of the chip.
icon-left icon name undefined no Sets an icon to be displayed on the left side of the chip.
icon-right icon name undefined no Sets an icon to be displayed on the right side of the chip.
over-color boolean false no Changes the background-color of the chip to be placed on a colored surface.
use-check-state-icon boolean false no Displays a checkmark icon on the chip when it is selected.
check-if-selected boolean false no Deprecated: Use useCheckStateIcon instead.

Displays a checkmark icon on the chip when it is selected.
width-behavior "fill" | "fit" "fit" no Defines the width behavior of the chip component. - "fill": The component expands to fill the available width. - "fit": The component width fits its content.
Slots
Slot Required Description
default yes Accepts one of the following elements: - <input type="checkbox"> for multi-selection - <input type="radio"> for single-selection - <button role="switch"> for switch behavior - <button> for button behavior - <a href="#"> for link behavior - <div data-masked-ref="..."> for masked link behavior - <a data-masked-ref="..."> for link switching - aria-current on <button> or <a> for current-marked behavior

If a non-interactive element is used, the chip will not have any interactive styles or behaviors applied to it.

If you want the chip to be checked initially, add "checked" to the <input>.

For more information on interactive components, refer to the interactive component slots documentation.
content no The text or HTML content displayed inside the chip.
image no Sets the image content of the chip. When providing an alt text, please end with a dot (.) to separate it from the label when read by screen readers.
Example:
<img src="" slot='image' alt="Alt text for image."/>
Events
Event Detail type Description
oc-property-change OcChipV3Events["oc-property-change"] Whenever a property value changes, this event triggers. Use this event to track all property changes within the component.

Refer to the Events documentation for more information.
oc-mount { component: string; } Fired when the component is mounted to the DOM. The event is fired when the onMount hook of the component is called by the runtime.
oc-unmount { component: string; } Fired when the component is unmounted from the DOM. The event is fired when the function returned by the onMount hook of the component is called by the runtime.
CSS custom properties
Custom property Default Description
--color undefined Sets the text color and icon color through a CSS variable. Note The preferred way of using colors is via design tokens instead of hex values.
--image-width Sets the width of the image container through a CSS variable.
--image-border-radius Sets the radius of the image container through a CSS variable.

Examples

Listed below are the most common variations of the chip component as well as specific component variations for different use cases.

Default

Default Component

HTML
<oc-chip-v3>
<label slot='content'>Label</label>
<input type='checkbox' aria-label='oc-auto'/>
</oc-chip-v3>
Icon Left

Variation with an icon on the left side of the chip label.

HTML
<oc-chip-v3 icon-left="arrow-left">
<label slot='content'>Icon and Text</label>
<input type='checkbox' aria-label='oc-auto'/>
</oc-chip-v3>
Icon Only

Variation with only an icon and no text label.

HTML
<oc-chip-v3 icon-left="like"><input type='checkbox' aria-label='like'/></oc-chip-v3>
Check Icon

Variation with a check icon replacing the left icon when the chip is selected.

HTML
<oc-chip-v3 icon-left="basket" use-check-state-icon>
<label slot='content'>I am showing a check icon if I am selected</label>
<input type='checkbox' checked aria-label='oc-auto'/>
</oc-chip-v3>
Virtual Assistant

Variation with a virtual assistant style using a sparkles icon and a custom purple color.

HTML
<oc-chip-v3 icon-left="sparkles" style="--color: var(--oc-base-color-purple-140)">
<button>test</button>
</oc-chip-v3>
Icon Right 200

Variation with an icon on the right side in size 200.

HTML
<oc-chip-v3 size="200" icon-right="arrow-right">
<label slot='content'>Chip 200 with Icon and Text</label>
<input type='checkbox' aria-label='oc-auto'/>
</oc-chip-v3>
Older versions

Migration to v3

Migration from Chip v2 to v3

The oc-chip component has been updated from oc-chip-v2 to oc-chip-v3. This migration guide provides step-by-step instructions to update your project to the latest version.

Skip to:

What's new
  • Slot-based interactivity — The chip no longer manages its own interactive element. Any standard HTML interactive element (<input>, <button>, <a>, <select>, etc.) can be placed in the default slot, giving full control over behavior, form integration, and accessibility.
  • icon-right — Icons can now be placed on both left and right sides simultaneously.
  • Better radio group support — Since a native <input type="radio"> is used, browser-native radio group behavior (keyboard navigation, form reset, mutual exclusivity) works out of the box without any chip-level configuration.
  • Full form compatibility — Native <input> and <button> elements handle form submission, reset, and validation natively without any chip-level wiring.
API changes
Removed
v2 prop / attribute Reason
selection="single|multi" Replaced by slotting <input type="radio"> or <input type="checkbox">
asButton / as-button Replaced by slotting a <button> element
base64Href / base64-href Replaced by slotting a <div data-masked-ref> or <a data-masked-ref>
checked Set checked directly on the slotted <input>
disabled Set disabled directly on the slotted <input> or <button>
name Set name directly on the slotted <input>
value Set value directly on the slotted <input>
ocAriaLabel / oc-aria-label Set aria-label directly on the slotted element
showRemoveIcon / show-remove-icon Use icon-right="clear" on the host instead
inverted Removed without replacement (was already deprecated, use over-color)
onColor / on-color Removed without replacement (was already deprecated, use over-color)
rel Set rel directly on the slotted <a>
target Set target directly on the slotted <a>
fillParent / fill-parent Replaced by width-behavior="fill"
Changed
v2 v3 Notes
icon icon-left Renamed for clarity; icon-right is now also available
show-check-icon use-check-state-icon Renamed; check-if-selected remains available as a deprecated alias
Default slot slot="content" Text content must now be placed in a <label slot="content">
size default No default v2 defaulted to "100"; v3 has no default — omit the attribute for the default appearance
Added
v3 prop / attribute Description
icon-right Displays an icon on the right side of the chip
width-behavior="fill|fit" Controls width (replaces fill-parent)
How to migrate

The fundamental architecture has changed: v2 managed interactivity internally via props (selection, asButton, base64Href). v3 delegates interactivity entirely to a slotted element in the default slot. This makes the chip more flexible and composable.

Selecting the right interactive element for your use case
Use Case Slotted Element Notes
Multi-select (checkboxes) <input type="checkbox"> Use native form element for automatic form integration
Single-select (radio buttons) <input type="radio"> Browser handles mutual exclusivity automatically
Toggle state button <button> with aria-pressed For simple toggled states without form submission
Navigation (current page) <a> with aria-current Use for navigation links; any value except "false" marks as selected
Custom toggle with semantics <button role="switch"> with aria-checked For switch-like behavior with explicit role
Simple action button <button> No ARIA state attributes needed
Dropdown/select <select> For native dropdown selection
Migrate a selectable chip (multi-selection / checkbox)
<!-- From: -->
<oc-chip-v2 selection="multi" name="brand" value="otto">Otto</oc-chip-v2>

<!-- To: -->
<oc-chip-v3>
  <input type="checkbox" name="brand" value="otto" aria-label="oc-auto" />
  <label slot="content">Otto</label>
</oc-chip-v3>
Migrate a selectable chip (single-selection / radio)
<!-- From: -->
<oc-chip-v2 selection="single" name="brand" value="otto">Otto</oc-chip-v2>

<!-- To: -->
<oc-chip-v3>
  <input type="radio" name="brand" value="otto" aria-label="oc-auto" />
  <label slot="content">Otto</label>
</oc-chip-v3>
Migrate a button chip
<!-- From: -->
<oc-chip-v2 as-button>Label</oc-chip-v2>

<!-- To (simple action button): -->
<oc-chip-v3>
  <button>Label</button>
</oc-chip-v3>

<!-- To (with toggled-on state via aria-pressed): -->
<oc-chip-v3>
  <button aria-pressed="true">Label</button>
</oc-chip-v3>

No changes needed — slotting an <a> element directly was already supported in v2 and works the same in v3:

HTML
<oc-chip-v3>
<a href="/page">Label</a>
</oc-chip-v3>
Migrate a checked/selected checkbox chip
<!-- From: -->
<oc-chip-v2 selection="multi" name="brand" value="otto" checked>Otto</oc-chip-v2>

<!-- To: -->
<oc-chip-v3>
  <input type="checkbox" name="brand" value="otto" aria-label="oc-auto" checked />
  <label slot="content">Otto</label>
</oc-chip-v3>
Migrate a selected radio button chip
<!-- From: -->
<oc-chip-v2 selection="single" name="brand" value="otto" checked>Otto</oc-chip-v2>

<!-- To: -->
<oc-chip-v3>
  <input type="radio" name="brand" value="otto" aria-label="oc-auto" checked />
  <label slot="content">Otto</label>
</oc-chip-v3>

There was no direct v2 equivalent — marking a link as the current page is new in v3. Add aria-current to the slotted <a>. Any value except "false" is treated as selected:

HTML
<oc-chip-v3>
<a href="/current" aria-current="page">Current Page</a>
</oc-chip-v3>
Migrate a removable chip
<!-- From: -->
<oc-chip-v2 show-remove-icon>Label</oc-chip-v2>

<!-- To: -->
<oc-chip-v3 icon-right="clear">
  <button>Label</button>
</oc-chip-v3>
Migrate fill-parent
<!-- From: -->
<oc-chip-v2 fill-parent>Label</oc-chip-v2>

<!-- To: -->
<oc-chip-v3 width-behavior="fill">
  <input type="checkbox" aria-label="oc-auto" />
  <label slot="content">Label</label>
</oc-chip-v3>

API v2

API: <oc-chip-v2> (ChipV2)

The chip component represents complex entities in compact form, such as tags or selected options. It offers interactive features like removal and disabling, and allows visual customization with inverted backgrounds, icons, and adjustable sizes.

Attributes / properties
Attribute Type Default Required Description
selection "single" | "multi" undefined no Specifies if and how the chip should be selectable.
size "100" | "200" undefined no Sets the size of the chip.
value string "on" no Sets the initial value of the chip for form processing. Mandatory if single-selection is set to true.
icon icon name undefined no Sets an icon to be displayed on the left side of the chip.

Note: When using only an icon without text, it is important to provide an appropriate oc-aria-label for accessibility purposes.
over-color boolean false no Changes the background-color of the chip to be placed on a colored surface.
on-color boolean false no Deprecated: Use overColor prop instead.

Changes the background-color of the chip to be placed on a colored surface.
inverted boolean false no Deprecated: Use overColor prop instead.

Changes the background-color of the chip to be placed on a colored surface.
checked boolean false no Toggles the state of the chip between checked and unchecked. Set to true to initially tick the chip.

Accessible in CSS via the custom-state mixin.

Only allowed in combination with selection="single" or selection="multi". This is required to ensure proper behavior and accessibility of selectable chips.
disabled boolean false no Disables the chip, preventing user interaction and input.
show-check-icon boolean false no Displays a checkmark icon on the chip when it is selected. This option only works if the properties showRemoveIcon and disabled are both set to false.
show-remove-icon boolean false no Displays an "x" icon on the chip.
fill-parent boolean false no Sets the width of the chip to match the width of the parent element.
name string undefined no Sets the name tag to identify the chip when submitting a form. Mandatory if single-selection is set to true.
base64-href string undefined no Sets the base64 encoded link target of the chip component. Use this attribute to prevent search engines from indexing the link target.
target "_blank" | "_self" | "_parent" | "_top" undefined no Sets the target attribute of the interactive component.

Note Only applies when base64Href is set.
rel string undefined no Sets the rel attribute of the interactive component.

Note Only applies when base64Href is set.
as-button boolean false no Determines if the chip behaves as a button. Set to true to make the chip behave as a button and trigger an action instead of navigating to a new page.
oc-aria-label string undefined no Sets the ARIA label of the chip.
Slots
Slot Required Description
default no Sets the text content of the chip.
image no Sets the image content of the chip. When providing an alt text, please end with a dot (.) to separate it from the label when read by screen readers.
Example:
<img src="" slot='image' alt="Alt text for image."/>
Events
Event Detail type Description
oc-property-change OcChipV2Events["oc-property-change"] Whenever a property value changes, this event triggers. Use this event to track all property changes within the component.

Refer to the Events documentation for more information.
oc-mount { component: string; } Fired when the component is mounted to the DOM. The event is fired when the onMount hook of the component is called by the runtime.
oc-unmount { component: string; } Fired when the component is unmounted from the DOM. The event is fired when the function returned by the onMount hook of the component is called by the runtime.
CSS custom properties
Custom property Default Description
--color undefined Sets the text color and icon color through a CSS variable. Note: The preferred way of using colors is via design tokens instead of hex values.
--image-width Sets the width of the image container through a CSS variable.
--image-border-radius Sets the radius of the image container through a CSS variable.