Veil UI
Components

List View

A bordered list of rich items with leading and trailing slots.

Installation

$ npx veil-ui@latest add list-view

Usage

import { ListItem, ListView } from "@/components/ui/list-view";

<ListView label="Files">
  <ListItem title="proposal.pdf" description="2.4 MB" />
  <ListItem title="hero.png" description="860 KB" />
</ListView>;

Examples

Basic

  • Design
    12 items
  • proposal.pdf
    2.4 MB
  • hero.png
    860 KB

Compact

  • Deployment finished
    2 minutes ago
  • New comment
    15 minutes ago

API reference

The package exports list-view along with its composable parts. It forwards standard attributes to its root element; see the examples above for the component-specific props.

Accessibility

  • Content uses semantic HTML — lists are lists, tables are tables and metadata uses a definition list.
  • Interactive elements are real buttons or links with visible focus states.
  • Images require meaningful alt text; icons used decoratively are aria-hidden.

Vue and plain HTML

This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add list-view --framework vue or switch the framework in components.json.

<script setup lang="ts">
import { cn } from "@/lib/utils";

const props = defineProps<{
  title: string;
  description?: string;
  class?: string;
}>();
</script>

<template>
  <li
    data-slot="list-item"
    :class="
      cn(
        'flex items-center gap-3 px-4 py-3 transition-colors hover:bg-muted/40',
        props.class,
      )
    "
  >
    <div v-if="$slots.leading" class="shrink-0">
      <slot name="leading" />
    </div>
    <div class="min-w-0 flex-1">
      <div class="truncate text-sm font-medium">
        <slot name="title">{{ title }}</slot>
      </div>
      <div v-if="description || $slots.description" class="truncate text-sm text-muted-foreground">
        <slot name="description">{{ description }}</slot>
      </div>
      <slot />
    </div>
    <div v-if="$slots.trailing" class="shrink-0">
      <slot name="trailing" />
    </div>
  </li>
</template>

On this page