Chip
Compact interactive element for tags, filters and selections with icon, close and group support.
Aperçu
Rendu de l’aperçu en cours…
defaultRendu de l’aperçu en cours…
primaryRendu de l’aperçu en cours…
successRendu de l’aperçu en cours…
closableRendu de l’aperçu en cours…
outlinedRendu de l’aperçu en cours…
labelStructure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<origam-chip> — 7 internal parts. The chip is a full-round pill by default. Absolute layers (overlay ⑥, underlay ⑦) handle interaction states.- 1.origam-chip
- Root element. Renders as
<span>by default; switches to<a>when a link prop is set. Pill shape by default (border-radius: 9999px). - 2.origam-chip__prepend
- Leading area. Renders
prependIconorprependAvatar, or the#prependslot. Present only whenhasPrepend. - 3.origam-chip__content
- Label zone. Contains the
#defaultslot text or thetextprop. Hasdata-no-activatorattribute. - 4.origam-chip__filter
- Filter check icon area. Visible only when
filter=trueand the chip is selected inside a ChipGroup. UsesOrigamExpandXtransition. - 5.origam-chip__close
- Close button (
OrigamBtn variant="text"). Present whenclosable=trueor the#closeslot is used. - 6.origam-chip__overlay
- Interaction overlay.
opacity: 0at rest → 0.24 on hover → 0.12 on focus. Present only when the chip is clickable. - 7.origam-chip__underlay
- Reserved absolute underlay.
position: absolute. Currently unpainted (no background).
API
Props
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.
- closablebooleanfalse
- Adds a close button that emits click:close and hides the chip via v-model.
- Icon for the close button.
- closeLabelstring'origam.close'
- Accessible aria-label for the close button.
- draggablebooleanfalse
- Makes the chip draggable via the HTML drag API.
- filterbooleanfalse
- Shows a filter icon (check) when the chip is selected inside a ChipGroup.
- Icon shown in filter mode when the chip is selected.
- labelbooleanfalse
- Switches border-radius to a square shape (label style).
- linkbooleanfalse
- Enables link behaviour when href or to is set.
- pillbooleanfalse
- Removes horizontal padding on prepend/append areas for a pill layout with flush avatars.
- textstring
- Chip label text. Can also be set via the default slot.
- modelValuebooleantrue
- Controls the chip visibility. Use v-model to bind two-way.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- appendAvatarstring
- Image URL for an avatar in the append area.
- appendIcon
- Icon displayed after the chip label.
- prependAvatarstring
- Image URL for an avatar in the prepend area.
- prependIcon
- Icon displayed before the chip label.
- prependAriaLabelstring
- appendAriaLabelstring
- tagstring'span'
- HTML element rendered at the root.
- color
- Intent or custom color applied to the chip surface.
- bgColor
- Background color override.
- rippleboolean | { class: string }true
- Enables the ripple effect on click.
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>false
- Applies a border. Pass true for outlined style.
- borderTopboolean | number | string
- borderLeftboolean | number | string
- borderBottomboolean | number | string
- borderRightboolean | number | string
- borderBlockboolean | number | string
- borderInlineboolean | number | string
- borderInlineStartboolean | number | string
- borderInlineEndboolean | number | string
- borderBlockStartboolean | number | string
- borderBlockEndboolean | number | string
- borderColorstring
- borderStylestring
- borderTopColorTColor
- borderRightColorTColor
- borderBottomColorTColor
- borderLeftColorTColor
- borderInlineStartColorTColor
- borderInlineEndColorTColor
- borderBlockStartColorTColor
- borderBlockEndColorTColor
- Border-radius token or boolean. Default is pill (full round).
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- paddingboolean | number | string
- paddingTopboolean | number | string
- paddingLeftboolean | number | string
- paddingBottomboolean | number | string
- paddingRightboolean | number | string
- paddingBlockboolean | number | string
- paddingInlineboolean | number | string
- paddingInlineStartboolean | number | string
- paddingInlineEndboolean | number | string
- paddingBlockStartboolean | number | string
- paddingBlockEndboolean | number | string
- marginboolean | number | string
- marginTopboolean | number | string
- marginLeftboolean | number | string
- marginBottomboolean | number | string
- marginRightboolean | number | string
- marginBlockboolean | number | string
- marginInlineboolean | number | string
- marginInlineStartboolean | number | string
- marginInlineEndboolean | number | string
- marginBlockStartboolean | number | string
- marginBlockEndboolean | number | string
- Adjusts padding density.
- valueany
- disabledbooleanfalse
- Disables the chip. Applies 30% opacity and removes pointer events.
- selectedClassstring
- hrefstring
- Renders the chip as an anchor tag pointing to this URL.
- replaceboolean
- toRouteLocationRaw
- Vue Router destination.
- exactboolean
- Controls the chip height and font-size via design tokens.
- elevationTElevation
- Box-shadow elevation token.
- activeboolean | IStateEffectConfig
- activeClassstring
- hoverboolean | IStateEffectConfig
- hoverClassstring
- fontSizeTFontSize
- fontWeightTFontWeight
- letterSpacingTLetterSpacing
- fontFamilyTFontFamily
- textTransformTTextTransform
API
Slots
Emplacements de contenu exposés par ce composant.
- #filter
- Custom filter icon rendered when the chip is selected in filter mode.
- #default
- Main chip label content. Receives group selection context props.
- #close
- Custom close button content. Receives closeIcon prop.
- #prepend
- Replaces the prepend icon/avatar area.
- #append
- Replaces the append icon/avatar area.
API
Emits
Événements émis par ce composant.
- @update:modelValueany
- Fired when the chip is dismissed. Sets modelValue to false.
- @clickMouseEvent
- Fired on chip click.
- @click:closeMouseEvent
- Fired when the close button is clicked.
- @click:appendMouseEvent
- Fired when the append area is clicked.
- @click:prependMouseEvent
- Fired when the prepend area is clicked.
- @group:selected{ value: boolean }
- @update:groupunknown
- Fired when the group selection changes (when inside a ChipGroup).
API
Membres exposés
Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.
- <T extends object>(props: T, exclude?: string[]) => Partial<T>
- Utility to forward a filtered subset of props to a child component.
- Ref<string>
- Reactive CSS string generated by useStyle from the computed chipStyles.
- string
- Unique style-sheet ID for this instance.
- () => void
- Injects the computed style sheet. Called automatically on mount.
- () => void
- Removes the injected style sheet. Called automatically on unmount.
- Ref<boolean>
- True once the style sheet has been injected into the DOM.
Personnalisation
Variables CSS
Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.
- Default chip background color.
- Default chip foreground (text/icon) color.
- Border radius. Full pill by default. Overridden by the label modifier to radius.sm.
- Chip label font weight.
- Opacity applied when the chip is disabled.
- Density offset: 0 (default), -8px (compact).
- Overlay opacity at rest. Animates to 0.24 on hover and 0.12 on focus/active.
Inclusion
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
Interactions clavier
| Touche | Action |
|---|---|
| Enter / Space | Activates the chip (fires click event) when it is clickable. |
| Tab | Moves focus to the next interactive element. Chip is focusable only when clickable (tabindex=0). |
Notes
- The close button receives an aria-label from the closeLabel prop, defaulting to the translated "Close" string.
- When disabled=true, the chip receives the disabled attribute and pointer events are removed.
- The overlay span receives focus-visible styles to indicate keyboard focus visually.
Fondation
Design tokens
Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.
- colorvar(--origam-color__surface---overlay)
- Default chip background.
- dimensionvar(--origam-radius---full)
- Full-pill border radius by default.
- fontWeightvar(--origam-font__weight---regular)
- Chip label font weight.
- colorvar(--origam-color__action--primary---bg)
- Background when the chip is selected inside a ChipGroup.
- numbervar(--origam-opacity---0)
- Overlay opacity at rest (0). Animates on hover/focus/active.
- durationvar(--origam-motion__duration---medium)
- Transition duration for overlay opacity animation.
Interactif
Playground
Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.
Rendu de l’aperçu en cours…
Usage
Exemples
Extraits de code prêts à coller dans vos templates.
Basic chips
Filter chips (ChipGroup)
Sizes
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.