Chip
A pill that toggles on and off. A row of them lets users pick any number of options.
<arc-chip>Overview
Chip is a pill that toggles between selected and unselected. Use a set of chips to pick zero or more options from a visible list: filters, tag pickers, interest pickers. It renders an arc-tag, so it has Tag's uppercase label. Unselected, it's a default Tag. Selected, it's a primary Tag: accent-primary border and text on an --accent-primary-subtle background.
On its own, a chip has the button role with aria-pressed. Inside an ancestor with role="listbox" or role="group", it switches to the option role with aria-selected. Enter and Space toggle it. A disabled chip leaves the tab order (tabindex="-1"). The slot takes any inline content, but plain text suits the uppercase styling best.
Each toggle fires arc-change with { value, selected }. There's no chip group component, so to manage a set, listen to arc-change on each chip and keep the selected values in your own state. value is an identifier for your code, separate from the visible label.
Guidelines
Do
- Give each chip a unique value
- Keep labels to one or two words
- Add a clear or reset action when chips act as active filters
Don't
- Don't use chips for mutually exclusive choices. Use SegmentedControl or RadioGroup
- Don't put a sentence in a chip
- Don't use a chip for navigation. It is an input, not a link
- Don't put buttons or links inside a chip
Features
- Glows on hover, in the variant color
- Disabled chips drop to 50% opacity and ignore the pointer
Preview
Usage
This component needs JavaScript. Use the Web Component or a framework wrapper.
<arc-chip value="react" selected>React</arc-chip>
<arc-chip value="vue">Vue</arc-chip>
<arc-chip value="svelte">Svelte</arc-chip>import { Chip } from '@arclux/arc-ui-react';
export default function Example() {
return (
<>
<Chip value="react" selected>React</Chip>
<Chip value="vue">Vue</Chip>
<Chip value="svelte">Svelte</Chip>
</>
);
}<script setup>
import { Chip } from '@arclux/arc-ui-vue';
</script>
<template>
<Chip value="react" selected>React</Chip>
<Chip value="vue">Vue</Chip>
<Chip value="svelte">Svelte</Chip>
</template><script>
import { Chip } from '@arclux/arc-ui-svelte';
</script>
<Chip value="react" selected>React</Chip>
<Chip value="vue">Vue</Chip>
<Chip value="svelte">Svelte</Chip>import { Component } from '@angular/core';
import { Chip } from '@arclux/arc-ui-angular';
@Component({
imports: [Chip],
template: `
<arc-chip value="react" [selected]="true">React</arc-chip>
<arc-chip value="vue">Vue</arc-chip>
<arc-chip value="svelte">Svelte</arc-chip>
`,
})
export class MyComponent {}import { Chip } from '@arclux/arc-ui-solid';
export default function Example() {
return (
<>
<Chip value="react" selected>React</Chip>
<Chip value="vue">Vue</Chip>
<Chip value="svelte">Svelte</Chip>
</>
);
}import { Chip } from '@arclux/arc-ui-preact';
export default function Example() {
return (
<>
<Chip value="react" selected>React</Chip>
<Chip value="vue">Vue</Chip>
<Chip value="svelte">Svelte</Chip>
</>
);
}API
valuestring''- Machine-readable identifier for this chip, included in the
arc-changeevent detail. selectedbooleanfalse- Whether the chip is currently selected. Reflected as an attribute and toggled on click or keypress.
disabledbooleanfalse- Disables interaction, reducing opacity to 40% and blocking pointer events.
Events
arc-changedetail:{ value: string, selected: boolean }- Fired when the chip selected state changes
See also
- TagA small uppercase pill for a category or filter, with an optional button to remove it.
- BadgeA small monospace pill that labels a status, a category or a count next to the thing it describes.
- Segmented ControlA row of buttons where exactly one is selected, built from arc-option children.
- Multi SelectA dropdown for picking several options, shown as removable chips.