Skip to content

OrigamChip ​

<OrigamChip> is a compact element that represents an input, attribute, or action. It renders as a <span> by default and supports labels, close buttons, filter icons, pill shapes, draggable behaviour, and group selection via OrigamChipGroup.

Basic usage ​

vue
<template>
    <OrigamChip text="My chip" />
</template>

Closable ​

Set closable to show a close icon. The chip emits click:close and hides itself (modelValue becomes false) when the icon is clicked.

vue
<template>
    <OrigamChip closable text="Closable" />
</template>

Filter ​

Inside a OrigamChipGroup, passing filter reveals a check icon when the chip is selected. The icon is driven by filterIcon (default: checkmark).

vue
<template>
    <OrigamChipGroup v-model="selected" filter>
        <OrigamChip :value="1" filter text="Option A" />
        <OrigamChip :value="2" filter text="Option B" />
    </OrigamChipGroup>
</template>

Shape — pill and label ​

A chip is fully round by default. The base rule is border-radius: var(--origam-chip---border-radius, 9999px), so <OrigamChip text="…"/> is already a pill and needs no prop.

label is the opt-out: it switches to a rectangular chip (var(--origam-chip---border-radius-label, 4px)) — useful for tags.

vue
<template>
    <OrigamChip label text="Tag" />
</template>

pill is the explicit opt-in: it restores the full radius over anything that squared it. On a chip that sets neither, pill changes nothing visible — it is only load-bearing when it has to win against label or against a rounded token.

vue
<template>
    <!-- Identical rendering: round is the default. -->
    <OrigamChip text="Pill chip" />
    <OrigamChip pill text="Pill chip" />

    <!-- Here `pill` matters: it wins over `label`. -->
    <OrigamChip pill label text="Round despite label" />
</template>

⛔ pill does not remove the chip's inner horizontal padding. Earlier revisions of this page said it did; no rule ever implemented that, and the padding stays governed by the --origam-chip---padding-{size} tokens.

Draggable ​

vue
<template>
    <OrigamChip draggable text="Drag me" />
</template>

Color ​

Pass any TIntent value via color or bgColor.

vue
<template>
    <OrigamChip color="primary" text="Primary" />
    <OrigamChip color="success" text="Success" />
    <OrigamChip color="danger"  text="Danger"  />
</template>

Size ​

vue
<template>
    <OrigamChip size="x-small" text="XS" />
    <OrigamChip size="small"   text="S"  />
    <OrigamChip size="default" text="M"  />
    <OrigamChip size="large"   text="L"  />
    <OrigamChip size="x-large" text="XL" />
</template>

Density ​

vue
<template>
    <OrigamChip density="compact"      text="Compact"      />
    <OrigamChip density="default"      text="Default"      />
    <OrigamChip density="comfortable"  text="Comfortable"  />
</template>

Prepend / Append icons ​

vue
<template>
    <OrigamChip prepend-icon="mdi-account" text="Profile" />
    <OrigamChip append-icon="mdi-chevron-down" text="More" />
</template>

Props ​

IChipProps layers eleven own props on top of sixteen Commons interfaces. The tables below cover the whole surface.

Content ​

PropTypeDefaultDescription
textstring—Chip body. Overridden by the #default slot.
tagstring'span'Root element. Note: a purely clickable chip renders a real <button> regardless (#530).
prependIcon / appendIconTIcon—Icons on either side of the body (IAdjacentProps).
prependAvatar / appendAvatarstring—Avatar image URLs on either side (IAdjacentProps).

Shape ​

PropTypeDefaultDescription
pillbooleanfalseExplicit full-radius opt-in. Round is already the default, so this only matters against label or a rounded token — see Shape.
labelbooleanfalseRectangular chip (--origam-chip---border-radius-label, 4px).
rounded (+ per-corner)TRounded—Radius token (IRoundedProps). Emits a utility class, which sits below the component's scoped rules in the cascade.
border (+ borderColor, borderStyle, per-edge)IBorderProps—Border surface.
elevationTElevation—Shadow token.

Colour ​

PropTypeDefaultDescription
colorTColor—Foreground colour — intent token or raw CSS.
bgColorTColor—Background colour.

Sizing ​

PropTypeDefaultDescription
sizeTSize | number'default'x-small → x-large. Each rung declares the chip's height, padding and font-size, so this default is load-bearing — without it no --size-* class is emitted and the chip collapses.
densityTDensity—Compacts the size rung.
padding* / margin*IPaddingProps / IMarginProps—Spacing surface.

Behaviour ​

PropTypeDefaultDescription
modelValuebooleantrueVisibility. Set to false by the close button.
closablebooleanfalseRenders the close button.
closeIconTIcon'mdi:mdi-close-circle-outline'Icon inside the close button.
closeLabelstring'origam.close'i18n key for the close button's accessible name — not a literal string.
filterbooleanfalseRenders the selection check when the chip is selected in a group.
filterIconTIcon'mdi:mdi-check'Icon used by filter.
draggableboolean—Native drag on the root.
linkboolean—Forces clickable behaviour without an href / to. isClickable is !disabled && (belongs to a group || link || has a router target).
href / to / replace / exactILinkProps—Router / anchor target. A chip with any of these becomes clickable.
value / disabled / selectedClassIGroupItemProps—Group membership inside <OrigamChipGroup>.
rippleboolean | { class: string }—Ripple on activation.

State effects ​

PropTypeDefaultDescription
hover (+ hoverClass)boolean | IStateEffectConfig—Forced / configured hover appearance (IHoverProps).
active (+ activeClass)boolean | IStateEffectConfig—Decorative forced-highlight state (IActiveProps). Unrelated to modelValue and to group selection.

Host ​

PropTypeDefaultDescription
id / class / styleICommonsComponentProps—Host identity and style passthrough.

Typography ​

PropTypeDefaultDescription
fontFamilyTFontFamily—Font-family token (sans · mono · serif). Sets --origam-chip---font-family. When unset the chip inherits the font of its context.
fontSizeTFontSize—Font-size token (xs · sm · md · lg · xl · 2xl · 3xl · 4xl · 5xl). Sets --origam-chip---font-size. When unset the size-variant value stays in control.
fontWeightTFontWeight—Font-weight token (regular · medium · semibold · bold · extrabold · black). Sets --origam-chip---font-weight. When unset the theme default (400) applies.

| letterSpacing | TLetterSpacing | — | Letter-spacing token (tight · normal · wide · wider · widest). Sets --origam-chip---letter-spacing. When unset the chip inherits the letter-spacing of its context. | | textTransform | TTextTransform | — | CSS text-transform keyword (none · uppercase · lowercase · capitalize), emitted verbatim into --origam-chip---text-transform. When unset the chip inherits the casing of its context. ITypographyProps.textTransform is a Commons prop; Chip is its first adopter. |

Emits ​

EventPayloadDescription
clickMouseEventRoot element clicked
click:closeMouseEventClose button clicked; modelValue set to false
click:prependMouseEventPrepend area clicked
click:appendMouseEventAppend area clicked
update:modelValuebooleanVisibility changed
group:selectedanySelection changed within a group

Slots ​

SlotScopeDescription
defaultcontentPropsChip label / body
prepend—Custom prepend content
append—Custom append content
close{ closeIcon }Custom close button
filter{ filterIcon }Custom filter/selection icon

Box model — the border adds to the height token ​

A chip is box-sizing: content-box. The --origam-chip---height-* tokens are therefore the height of the content box: border-width is added on top of them. The small size declares --origam-chip---height-sm: 24px; with a 1 px border on each side it measures 26 px.

This is deliberate (#530): a clickable chip renders as a <button>, which the browser styles border-box; pinning content-box keeps the same height whatever the tag (without the pin a bordered chip drops from 26 px to 24 px).

Tokens ​

VariableDefaultUsed for
--origam-chip---background-color(unset)chip fill
--origam-chip---color(unset)chip text color
--origam-chip---border-colorcurrentColorborder color
--origam-chip---border-radius9999pxpill shape
--origam-chip---border-width0pxborder thickness
--origam-chip---font-weight400label weight
--origam-chip---font-family(unset, inherits)label font family
--origam-chip---letter-spacing(unset, inherits)label letter spacing
--origam-chip---text-transform(unset, inherits)label casing
--origam-chip---opacity-disabled0.3disabled opacity
--origam-chip__close---cursorpointerclose icon cursor
--origam-chip__close---font-size18pxclose icon size
--origam-chip__overlay---opacity0hover/focus overlay opacity