Components
Chip
Alias of Badge for compact, pill-like labels.
Installation
$ npx veil-ui@latest add chipUsage
import { Chip } from "@/components/ui/chip";
<Chip variant="muted">React</Chip>;Examples
Basic
ReactTypeScriptTailwind
Filter
API reference
Chip and chipVariants re-export Badge. Use
muted for neutral metadata and secondary for filters.
Accessibility
- Chips that can be removed should be buttons with a descriptive accessible name; this alias is for static labels.
Vue and plain HTML
This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add chip --framework vue or switch the framework in components.json.
<script setup lang="ts">
import { Badge } from "@/components/ui/badge";
const props = withDefaults(
defineProps<{
variant?:
| "default"
| "secondary"
| "outline"
| "muted"
| "destructive";
asChild?: boolean;
class?: string;
}>(),
{ asChild: false },
);
</script>
<template>
<Badge
:variant="props.variant"
:as-child="props.asChild"
:class="props.class"
>
<slot />
</Badge>
</template>