Category labels
Label a project, record, or item with a short category name. Use consistent variant meaning across the app, and use text as well as color to carry the meaning.
Components / Display
A compact, static label for categories and workflow details. Chip can use a CSS color seed to create a theme-adaptive colored fill.
Last changed in version 0.13.0: Add avatar groups and chips, expand the block gallery, and improve component colors, spacing, and motion.
bunx --bun @getweini/cli@latest add chipImport the file copied by the install command, then use Chip for a short, static label. The default example shows the component without customization.
<script setup lang="ts">
import Chip from './components/ui/chip/Chip.vue'
</script>
<template>
<Chip>In review</Chip>
</template>Chip is a static label. Use Badge for a rectangular label, TagsInput for editable strings, or ToggleGroup for selectable filters.
Label a project, record, or item with a short category name. Use consistent variant meaning across the app, and use text as well as color to carry the meaning.
Place a non-interactive status beside a title or list item when users only need to read it. Chip does not select, dismiss, or perform an action.
Compare default, secondary, and destructive variants in default, outline, and ghost modes. Choose a variant consistently instead of assigning meaning by color alone.
<script setup lang="ts">
import Chip from './components/ui/chip/Chip.vue'
const variants = ['default', 'secondary', 'destructive'] as const
const modes = ['default', 'outline', 'ghost'] as const
</script>
<template>
<div class="grid gap-3">
<div v-for="mode in modes" :key="mode" class="flex flex-wrap items-center gap-2">
<Chip v-for="variant in variants" :key="variant" :variant="variant" :mode="mode">
{{ variant }} ·{{ mode }}
</Chip>
</div>
</div>
</template>Seed the tint with a CSS color or the theme's --chart-2 token. The example shows the filled, outline, and ghost treatments; arbitrary colors are not contrast-certified.
<script setup lang="ts">
import Chip from './components/ui/chip/Chip.vue'
</script>
<template>
<div class="flex flex-wrap items-center gap-2">
<Chip color="blue">Named color</Chip>
<Chip color="#7c3aed">Hex color</Chip>
<Chip color="oklch(0.68 0.16 55)">OKLCH color</Chip>
<Chip color="var(--chart-2)">Theme token</Chip>
<Chip mode="outline" color="var(--chart-2)">Outline</Chip>
<Chip mode="ghost" color="var(--chart-2)">Ghost</Chip>
</div>
</template>Use the prefix slot for a decorative mark and the suffix slot for useful trailing text. Keep meaningful values, such as a count, available to assistive technology.
<script setup lang="ts">
import Chip from './components/ui/chip/Chip.vue'
</script>
<template>
<div class="flex flex-wrap items-center gap-2">
<Chip color="var(--success)">
<template #prefix>
<span aria-hidden="true" class="size-1.5 rounded-full bg-current" />
</template>
Synced
<template #suffix>2 min ago</template>
</Chip>
<Chip color="var(--warning)">
<template #prefix><span aria-hidden="true">!</span></template>
Needs review
<template #suffix>3 files</template>
</Chip>
</div>
</template>Compose static labels in a native list row to show project status. The text remains readable when the list wraps on a narrow screen.
<script setup lang="ts">
import Chip from './components/ui/chip/Chip.vue'
const projects = [
{ name: 'Atlas redesign', status: 'In review', color: 'var(--warning)' },
{ name: 'Mobile navigation', status: 'Ready', color: 'var(--success)' },
{ name: 'Billing updates', status: 'Blocked', color: 'var(--destructive)' },
] as const
</script>
<template>
<ul class="grid min-w-0 gap-2">
<li
v-for="project in projects"
:key="project.name"
class="flex min-w-0 flex-wrap items-center justify-between gap-2 rounded-md border p-3"
>
<span class="min-w-0">{{ project.name }}</span>
<Chip :color="project.color">{{ project.status }}</Chip>
</li>
</ul>
</template>Every public prop, slot, and native span attribute is listed below.
| Name | Type or signature | Default | What it does |
|---|---|---|---|
variantprop | "default" | "destructive" | "secondary" | undefined | "default" | Choose the visual treatment for this component. |
modeprop | "default" | "outline" | "ghost" | undefined | "default" | Choose the selection or display mode. |
colorprop | string | undefined | Not set | color accepts any CSS color value, including named colors, hex, rgb(), |
defaultslot | () => unknown | Required | Content shown inside Chip. |
prefixslot | (() => unknown) | undefined | Optional | Content shown before the main label or value. |
suffixslot | (() => unknown) | undefined | Optional | Content shown after the main label or value. |
// packages/frameworks/vue/components/chip/types.ts
import type { chipModes, chipVariants } from './styles'
// ------- TYPES -------
export interface ChipProps {
variant?: keyof typeof chipVariants
mode?: keyof typeof chipModes
color?: string
}
// packages/frameworks/vue/components/chip/styles.ts
// Color meaning and display mode can be changed independently.
export const chipVariants = {
default: '[--chip-color:var(--primary)]',
secondary: '[--chip-color:var(--secondary-foreground)]',
destructive: '[--chip-color:var(--destructive)]',
} as const
export const chipModes = {
default:
'border-transparent [background-color:color-mix(in_oklab,var(--chip-color)_18%,var(--card))]',
outline: 'border-current bg-transparent',
ghost: 'border-transparent bg-transparent',
} as constvariant selects default, secondary, or destructive; mode independently selects default, outline, or ghost; color accepts a CSS color seed, including a CSS custom property.span with default, prefix, and suffix slots. It does not provide selection, dismissal, or action behavior.color-mix() with theme surface, border, and foreground tokens. Check arbitrary colors in each supported theme; they are not contrast-certified.aria-hidden="true"; leave useful suffix content, including counts, readable to assistive technology.