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 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.
<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 chip200HTML
<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-lineHTML
<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.
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.
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.
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.
Only the latest version (v3) is allowed for generation. Older versions are kept for reference and are deprecated.
Overview (v3)
Chip
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.
This component is configurable, allowing you to tailor its features and appearance to your specific needs.
To explore all the available options and adjust the component, use the component configurator and see the changes affect the component in real-time.
Usage guidelines
Before integrating the chip component into your project, make sure you have correctly installed the OTTO components package.
Look through the variations page for examples of possible component variations.
Here, you can discover both common and specific variations that address different use cases.
This component has visual overflow.
It extends beyond its bounding box and is clipped by parent containers with overflow: hidden.
Ensure the parent container has sufficient padding to accommodate the component's full visual area.
Accessibility for content placed in the slot is the responsibility of the elements used within it.
The chip recognizes the following ARIA attributes on the slotted interactive element to reflect a selected/checked visual state:
Attribute
Usage
aria-current
Use on <a>, <button>, or <div> elements to indicate the current page, step, or item. Any value except "false" is treated as selected.
aria-pressed="true"
Use on <button> elements to indicate a toggled-on state (mutually exclusive with aria-checked).
aria-checked="true"
Use on custom interactive elements (e.g. role="checkbox" or role="switch") to indicate a checked state.
Icon-only chips
When using icon-left or icon-right without a text label in the content slot, the chip has no visible text for screen readers.
In this case, provide an aria-label directly on the slotted interactive element:
When using the image slot, always provide an alt attribute on the image. End the alt text with a period (.) so screen readers insert a natural pause between the image description and the chip label:
The use-check-state-icon attribute shows a visual checkmark icon when the chip is selected. This icon is decorative — it is not perceived by screen readers. The selected state must always be communicated semantically via the slotted element (e.g. checked on an <input>, or the ARIA attributes listed above). Do not rely on the checkmark icon alone to convey selection.
Deprecated
The check-if-selected attribute remains available for compatibility. Use use-check-state-icon instead.
Configuration (v3)
Chip V3 configuration
Configure the chip component with the controls below and see the changes live in the preview canvas.
Click the Show code button within the preview canvas to see the source code for the current component configuration.
Interactive configurator (Storybook controls); every option is listed in the API section of this file.
Migration (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.
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)
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:
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 (428 values; see Icon list in `storybook/components/icon/README.md`)
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.
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.
API v3
Chip v3 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 (428 values; see Icon list in `storybook/components/icon/README.md`)
undefined
no
Sets an icon to be displayed on the left side of the chip.
icon-right
icon name (428 values; see Icon list in `storybook/components/icon/README.md`)
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.
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.
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.
Variations (v3)
Variations
Listed below are the most common variations of the chip component as well as specific component variations for different use cases.
You can explore all available options using the component configurator, adjust the component to your needs, and see the changes live in a preview canvas.
Variation with a check icon replacing the left icon when the chip is selected.
Args: icon-left=basket, use-check-state-icon=true, defaultSlot=<input type='checkbox' checked aria-label='oc-auto'/>, contentSlot=<label slot='content'>I am showing a check icon if I am selected</label>
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>
The chip can be marked as checked using a checkbox, a radio button, a switch button,
or a current-marked link in the default slot. See
marking content as checked
for guidance on choosing the right pattern.
Demo with multiline text content at various fixed widths for both size 100 and size 200,
including combinations of icons and images.
<oc-chip-v3 style="width: 137px">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">This is a default chip</label>
</oc-chip-v3>
<oc-chip-v3 style="width: 122px">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">This is a chip with two lines</label>
</oc-chip-v3>
<oc-chip-v3 style="width: 247px">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip that goes as far as possible but when it reaches the container’s limit
breaks to several lines.
</label>
</oc-chip-v3>
<oc-chip-v3 style="width: 243px" icon-left="smiley-positive">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. And we have an icon on the
left.
</label>
</oc-chip-v3>
<oc-chip-v3 style="width: 247px">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. And we have an image on the
left.
</label>
<img slot="image" src="${placeholderImg}" alt="Placeholder image." />
</oc-chip-v3>
<oc-chip-v3 style="width: 247px" icon-left="smiley-positive" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. And we have an icon on the
left.
</label>
</oc-chip-v3>
<oc-chip-v3 style="width: 251px" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. We also support icons on the
right.
</label>
<img slot="image" src="${placeholderImg}" alt="Placeholder image." />
</oc-chip-v3>
<oc-chip-v3 style="width: 231px" icon-right="arrow-down">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 4 of them. We also support icons on the
right. They may even be different ones.
</label>
</oc-chip-v3>
<br />
<oc-chip-v3 style="width: 156px" size="200">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">This is a default chip</label>
</oc-chip-v3>
<oc-chip-v3 style="width: 145px" size="200">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">This is a chip with two lines</label>
</oc-chip-v3>
<oc-chip-v3 style="width: 276px" size="200">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip that goes as far as possible but when it reaches the container’s limit
breaks to several lines.
</label>
</oc-chip-v3>
<oc-chip-v3 style="width: 280px" size="200" icon-left="smiley-positive">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. And we have an icon on the
left.
</label>
</oc-chip-v3>
<oc-chip-v3 style="width: 280px" size="200">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. And we have an image on the
left.
</label>
<img slot="image" src="${placeholderImg}" alt="Placeholder image." />
</oc-chip-v3>
<oc-chip-v3 style="width: 300px" size="200" icon-left="smiley-positive" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. And we have an icon on the
left.
</label>
</oc-chip-v3>
<oc-chip-v3 style="width: 300px" size="200" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. We also support icons on the
right.
</label>
<img slot="image" src="${placeholderImg}" alt="Placeholder image." />
</oc-chip-v3>
<oc-chip-v3 style="width: 300px" size="200" icon-right="arrow-down">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 4 of them. We also support icons on the
right. They may even be different ones.
</label>
</oc-chip-v3>
<style>
oc-chip-v3 {
margin: 8px 0;
}
</style>
Story source (TypeScript, verbatim from Storybook)
{
name: "Demo: Multilines",
parameters: {
controls: {
disabled: true
},
chromatic: {
hideInChromatic: true,
disableSnapshot: true
}
},
argTypes: hideControlsBadge(Metadata),
render() {
return html`
<oc-chip-v3 style="width: 137px">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">This is a default chip</label>
</oc-chip-v3>
<oc-chip-v3 style="width: 122px">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">This is a chip with two lines</label>
</oc-chip-v3>
<oc-chip-v3 style="width: 247px">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip that goes as far as possible but when it reaches the container’s limit
breaks to several lines.
</label>
</oc-chip-v3>
<oc-chip-v3 style="width: 243px" icon-left="smiley-positive">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. And we have an icon on the
left.
</label>
</oc-chip-v3>
<oc-chip-v3 style="width: 247px">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. And we have an image on the
left.
</label>
<img slot="image" src="${placeholderImg}" alt="Placeholder image." />
</oc-chip-v3>
<oc-chip-v3 style="width: 247px" icon-left="smiley-positive" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. And we have an icon on the
left.
</label>
</oc-chip-v3>
<oc-chip-v3 style="width: 251px" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. We also support icons on the
right.
</label>
<img slot="image" src="${placeholderImg}" alt="Placeholder image." />
</oc-chip-v3>
<oc-chip-v3 style="width: 231px" icon-right="arrow-down">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 4 of them. We also support icons on the
right. They may even be different ones.
</label>
</oc-chip-v3>
<br />
<oc-chip-v3 style="width: 156px" size="200">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">This is a default chip</label>
</oc-chip-v3>
<oc-chip-v3 style="width: 145px" size="200">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">This is a chip with two lines</label>
</oc-chip-v3>
<oc-chip-v3 style="width: 276px" size="200">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip that goes as far as possible but when it reaches the container’s limit
breaks to several lines.
</label>
</oc-chip-v3>
<oc-chip-v3 style="width: 280px" size="200" icon-left="smiley-positive">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. And we have an icon on the
left.
</label>
</oc-chip-v3>
<oc-chip-v3 style="width: 280px" size="200">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. And we have an image on the
left.
</label>
<img slot="image" src="${placeholderImg}" alt="Placeholder image." />
</oc-chip-v3>
<oc-chip-v3 style="width: 300px" size="200" icon-left="smiley-positive" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. And we have an icon on the
left.
</label>
</oc-chip-v3>
<oc-chip-v3 style="width: 300px" size="200" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. We also support icons on the
right.
</label>
<img slot="image" src="${placeholderImg}" alt="Placeholder image." />
</oc-chip-v3>
<oc-chip-v3 style="width: 300px" size="200" icon-right="arrow-down">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 4 of them. We also support icons on the
right. They may even be different ones.
</label>
</oc-chip-v3>
<style>
oc-chip-v3 {
margin: 8px 0;
}
</style>
`;
}
}
Demo with width-behavior="fill" causing the chip to stretch to its parent container's width,
shown with various icon and image combinations for both size 100 and size 200.
<div style="width: 250px;">
<oc-chip-v3 width-behavior="fill">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">This is a default chip</label>
</oc-chip-v3>
<oc-chip-v3 width-behavior="fill" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">This is a chip with icon-right</label>
</oc-chip-v3>
<oc-chip-v3 width-behavior="fill" icon-left="smiley-positive" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content"> This is with icon-left and -right </label>
</oc-chip-v3>
<oc-chip-v3 width-behavior="fill">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">This is a chip with image</label>
<img slot="image" src="${placeholderImg}" alt="Placeholder image." />
</oc-chip-v3>
<oc-chip-v3 width-behavior="fill" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">This is a chip with image and icon</label>
<img slot="image" src="${placeholderImg}" alt="Placeholder image." />
</oc-chip-v3>
<oc-chip-v3 width-behavior="fill">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip that goes as far as possible but when it reaches the container’s limit
breaks to several lines.
</label>
</oc-chip-v3>
<oc-chip-v3 width-behavior="fill" icon-left="smiley-positive">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. And we have an icon on the
left.
</label>
</oc-chip-v3>
<oc-chip-v3 width-behavior="fill">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. And we have an image on the
left.
</label>
<img slot="image" src="${placeholderImg}" alt="Placeholder image." />
</oc-chip-v3>
<oc-chip-v3 width-behavior="fill" icon-left="smiley-positive" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. We also support icons on
the right.
</label>
</oc-chip-v3>
<oc-chip-v3 width-behavior="fill" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. We also support icons on
the right.
</label>
<img slot="image" src="${placeholderImg}" alt="Placeholder image." />
</oc-chip-v3>
<oc-chip-v3 width-behavior="fill" icon-right="arrow-down">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 4 of them. We also support icons on
the right. They may even be different ones.
</label>
</oc-chip-v3>
</div>
<br />
<div style="width: 320px;">
<oc-chip-v3 size="200" width-behavior="fill">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">This is a default chip</label>
</oc-chip-v3>
<oc-chip-v3 size="200" width-behavior="fill" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">This is a chip with icon-right</label>
</oc-chip-v3>
<oc-chip-v3 size="200" width-behavior="fill" icon-left="smiley-positive" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content"> This is with icon-left and -right </label>
</oc-chip-v3>
<oc-chip-v3 size="200" width-behavior="fill">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">This is a chip with image</label>
<img slot="image" src="${placeholderImg}" alt="Placeholder image." />
</oc-chip-v3>
<oc-chip-v3 size="200" width-behavior="fill" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">This is a chip with image and icon</label>
<img slot="image" src="${placeholderImg}" alt="Placeholder image." />
</oc-chip-v3>
<oc-chip-v3 size="200" width-behavior="fill">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip that goes as far as possible but when it reaches the container’s limit
breaks to several lines.
</label>
</oc-chip-v3>
<oc-chip-v3 size="200" width-behavior="fill" icon-left="smiley-positive">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. And we have an icon on the
left.
</label>
</oc-chip-v3>
<oc-chip-v3 size="200" width-behavior="fill">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. And we have an image on the
left.
</label>
<img slot="image" src="${placeholderImg}" alt="Placeholder image." />
</oc-chip-v3>
<oc-chip-v3 size="200" width-behavior="fill" icon-left="smiley-positive" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. We also support icons on
the right.
</label>
</oc-chip-v3>
<oc-chip-v3 size="200" width-behavior="fill" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. We also support icons on
the right.
</label>
<img slot="image" src="${placeholderImg}" alt="Placeholder image." />
</oc-chip-v3>
<oc-chip-v3 size="200" width-behavior="fill" icon-right="arrow-down">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 4 of them. We also support icons on
the right. They may even be different ones.
</label>
</oc-chip-v3>
</div>
<style>
oc-chip-v3 {
margin: 8px 0;
}
</style>
Story source (TypeScript, verbatim from Storybook)
{
name: "Demo: Fill Parent",
parameters: {
controls: {
disabled: true
},
chromatic: {
hideInChromatic: true
}
},
argTypes: hideControlsBadge(Metadata),
render() {
return html`
<div style="width: 250px;">
<oc-chip-v3 width-behavior="fill">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">This is a default chip</label>
</oc-chip-v3>
<oc-chip-v3 width-behavior="fill" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">This is a chip with icon-right</label>
</oc-chip-v3>
<oc-chip-v3 width-behavior="fill" icon-left="smiley-positive" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content"> This is with icon-left and -right </label>
</oc-chip-v3>
<oc-chip-v3 width-behavior="fill">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">This is a chip with image</label>
<img slot="image" src="${placeholderImg}" alt="Placeholder image." />
</oc-chip-v3>
<oc-chip-v3 width-behavior="fill" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">This is a chip with image and icon</label>
<img slot="image" src="${placeholderImg}" alt="Placeholder image." />
</oc-chip-v3>
<oc-chip-v3 width-behavior="fill">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip that goes as far as possible but when it reaches the container’s limit
breaks to several lines.
</label>
</oc-chip-v3>
<oc-chip-v3 width-behavior="fill" icon-left="smiley-positive">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. And we have an icon on the
left.
</label>
</oc-chip-v3>
<oc-chip-v3 width-behavior="fill">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. And we have an image on the
left.
</label>
<img slot="image" src="${placeholderImg}" alt="Placeholder image." />
</oc-chip-v3>
<oc-chip-v3 width-behavior="fill" icon-left="smiley-positive" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. We also support icons on
the right.
</label>
</oc-chip-v3>
<oc-chip-v3 width-behavior="fill" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. We also support icons on
the right.
</label>
<img slot="image" src="${placeholderImg}" alt="Placeholder image." />
</oc-chip-v3>
<oc-chip-v3 width-behavior="fill" icon-right="arrow-down">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 4 of them. We also support icons on
the right. They may even be different ones.
</label>
</oc-chip-v3>
</div>
<br />
<div style="width: 320px;">
<oc-chip-v3 size="200" width-behavior="fill">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">This is a default chip</label>
</oc-chip-v3>
<oc-chip-v3 size="200" width-behavior="fill" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">This is a chip with icon-right</label>
</oc-chip-v3>
<oc-chip-v3 size="200" width-behavior="fill" icon-left="smiley-positive" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content"> This is with icon-left and -right </label>
</oc-chip-v3>
<oc-chip-v3 size="200" width-behavior="fill">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">This is a chip with image</label>
<img slot="image" src="${placeholderImg}" alt="Placeholder image." />
</oc-chip-v3>
<oc-chip-v3 size="200" width-behavior="fill" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">This is a chip with image and icon</label>
<img slot="image" src="${placeholderImg}" alt="Placeholder image." />
</oc-chip-v3>
<oc-chip-v3 size="200" width-behavior="fill">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip that goes as far as possible but when it reaches the container’s limit
breaks to several lines.
</label>
</oc-chip-v3>
<oc-chip-v3 size="200" width-behavior="fill" icon-left="smiley-positive">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. And we have an icon on the
left.
</label>
</oc-chip-v3>
<oc-chip-v3 size="200" width-behavior="fill">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. And we have an image on the
left.
</label>
<img slot="image" src="${placeholderImg}" alt="Placeholder image." />
</oc-chip-v3>
<oc-chip-v3 size="200" width-behavior="fill" icon-left="smiley-positive" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. We also support icons on
the right.
</label>
</oc-chip-v3>
<oc-chip-v3 size="200" width-behavior="fill" icon-right="close">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 3 of them. We also support icons on
the right.
</label>
<img slot="image" src="${placeholderImg}" alt="Placeholder image." />
</oc-chip-v3>
<oc-chip-v3 size="200" width-behavior="fill" icon-right="arrow-down">
<input type="checkbox" aria-label="oc-auto" />
<label slot="content">
This is a chip with even more lines, in fact it’s 4 of them. We also support icons on
the right. They may even be different ones.
</label>
</oc-chip-v3>
</div>
<style>
oc-chip-v3 {
margin: 8px 0;
}
</style>
`;
}
}
Demo with a native <select> element as the primary action, displaying the selected value
in the chip label and providing a secondary clear action to remove the chip.
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.
Default variation
<oc-chip-v2>Label</oc-chip-v2>
Configuration
The chip component is configurable, allowing you to tailor its features and appearance to your specific needs.
To explore all the available options and adjust the component, use the component configurator and see the changes affect the component in real-time.
Usage guidelines
Before integrating the chip component into your project, make sure you have correctly installed the OTTO components package.
Look through the variations page for examples of possible component variations. Here, you can discover both common and specific variations that address different use cases.
To make the chip recognizable for screen readers, use the default slot to provide clear and descriptive label.
Use the aria-label attribute on the label to provide additional context if the visible label is not sufficient.
See the general accessibility documentation for guidance on using oc-aria-label, including how it works with link and masked link behavior.
Note: Removable chips by default have an extended label called "entfernen" that is visually hidden and read by screen readers as "some label entfernen".
You can bypass this behavior by using the oc-aria-label attribute which overwrites the default label as well as the label extension "entfernen".
Keyboard navigation
The chip component supports keyboard navigation for accessibility purposes.
The following table lists the keyboard shortcuts available for this component:
Shortcut
Description
Tab
Focuses the chip.
Space
While focused, checks the chip.
Image alt text
When adding an image with the image slot, ensure to provide meaningful alt text using the alt attribute and please
have in mind that this text will be read right before the label of the chip by screen readers. For best user experience,
add a dot (".") at the end of the alt text to separate it from the label when read by screen readers.
V2/Configuration (v2, deprecated, not for generation)
Chip configuration
Configure the chip component with the controls below and see the changes live in the preview canvas.
Click the Show code button within the preview canvas to see the source code for the current component configuration.
<oc-chip-v2>Label</oc-chip-v2>
Interactive configurator (Storybook controls); every option is listed in the API section of this file.
V2/Variations (v2, deprecated, not for generation)
Variations
Listed below are the most common variations of the chip component as well as specific component variations for different use cases.
You can explore all available options using the component configurator, adjust the component to your needs, and see the changes live in a preview canvas.
When providing an alt attribute for the image, please add a dot (".") at the
end of the alt text to separate it from the label when read by screen readers.
The chip component as a link with switch behavior. Search engines will detect the href, while users receive the Base64-encoded version.
Args: base64-href=Iz92YXJpYW50PWZvbw==, defaultSlot=<!--Search engines will detect the href, while users receive the Base64-encoded version.--><a href='#'>Label</a>
<oc-chip-v2 base64-href="Iz92YXJpYW50PWZvbw==">
<!--Search engines will detect the href, while users receive the Base64-encoded version.--><a href='#'>Label</a>
</oc-chip-v2>