List View

A mobile settings-style list. ListView renders an optional rounded, bordered card group; ListItem renders a row with title, description, leading icon, trailing content, and an optional chevron.

Usage

<script>
  import { ListView, ListItem } from '@vultra/ui';
  import { Settings, User, Bell } from 'lucide-svelte';
</script>

<ListView>
  <ListItem
    title="Account"
    description="Manage your profile"
    leading={() => <User />}
    chevron
  />
  <ListItem
    title="Notifications"
    description="2 unread"
    leading={() => <Bell />}
    trailing={() => <span class="text-xs">On</span>}
    onclick={() => console.log('open notifications')}
  />
  <ListItem title="Delete" destructive />
</ListView>

Props

ListView

PropTypeDefaultDescription
insetbooleantrueGroup the list in a rounded, bordered card
classstringAdditional CSS classes
childrenSnippetList items

ListItem

PropTypeDefaultDescription
titlestringRow title
descriptionstringOptional secondary text
leadingSnippetIcon/content rendered on the left
trailingSnippetContent rendered on the right
chevronbooleanfalseShow a chevron navigation hint
onclick(e: MouseEvent) => voidRenders the row as a button when set
disabledbooleanfalseDisables the row button
classstringAdditional CSS classes

Features

  • inset groups rows in a mobile settings-style card.
  • Rows become buttons when onclick is provided.
  • Leading/trailing snippets for flexible row composition.
  • Chevron affordance for navigation rows.
  • Rows divide by the border token.