Components
List
Ordered and unordered lists with marker, spacing and layout presets.
Installation
$ npx veil-ui@latest add listUsage
import { List, ListItem } from "@/components/ui/list";
<List>
<ListItem>Copy the source</ListItem>
<ListItem>Own the code</ListItem>
</List>;Examples
Bullet
- Copy the source
- Own the code
- Keep the styles
Ordered
- Run the init command
- Add a component
- Edit it to fit
Unstyled
- Design tokens
- Primitives
- Blocks
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| as | "ul" | "ol" | "ul" | List element; use ol with the decimal variant. |
| variant | "disc" | "decimal" | "none" | "disc" | Marker style, or none for layout-only lists. |
| spacing | "sm" | "md" | "lg" | "md" | Vertical rhythm between items. |
Accessibility
- Renders native list elements, so screen readers announce item counts and position.
- Markers pick up the muted foreground color while keeping the text readable.
- Use
variant="none"for navigation-like layouts only when the items are links; otherwise keep markers for scannability.
Vue and plain HTML
This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add list --framework vue or switch the framework in components.json.
<script setup lang="ts">
import { computed } from "vue";
import { cn } from "@/lib/utils";
const props = withDefaults(
defineProps<{
as?: "ul" | "ol";
variant?: "disc" | "decimal" | "none";
spacing?: "sm" | "md" | "lg";
class?: string;
}>(),
{ as: "ul", variant: "disc", spacing: "md" },
);
const variants = {
disc: "list-disc pl-5",
decimal: "list-decimal pl-5",
none: "list-none pl-0",
};
const spacings = {
sm: "space-y-1",
md: "space-y-2",
lg: "space-y-3",
};
const classes = computed(() =>
cn(
"marker:text-muted-foreground",
variants[props.variant],
spacings[props.spacing],
props.class,
),
);
</script>
<template>
<component :is="as" data-slot="list" :class="classes">
<slot />
</component>
</template>