Collections
Vertical lists for grouped content such as menus, settings, and feeds, with optional icons, supporting text, and hoverable or linked items.
Collection List
- JDJohn DoeSoftware Engineer
- JSJane SmithDesigner
- MJMike JohnsonProduct Manager
Collection with Actions
- Item with actionClick to view details
- Another itemWith action button
Usage
<script setup lang="ts">
import { VdCollection } from "@vanduo-oss/vd3";
const items = [
{ id: 1, title: "Ada Lovelace", subtitle: "Engineer", avatar: "/ada.jpg" },
{ id: 2, title: "Alan Turing", subtitle: "Mathematician" },
];
</script>
<template>
<VdCollection :items="items" header="Team" hoverable bordered />
</template>API Reference
| Class Name | Description | Type |
|---|---|---|
.vd-collection | Base component container class, typically applied to <ul>. | Component |
.vd-collection-item | Child element representing a single list item, typically <li>. Add .active to show selected state. | Sub-component |
.vd-collection-avatar | Container for leading visual media like avatars or icons. | Sub-component |
.vd-collection-content | Wrapper for textual content inside an item (title and subtitle). | Sub-component |
.vd-collection-title | The primary heading or text of the collection item. | Sub-component |
.vd-collection-text | The secondary descriptive text of the collection item. | Sub-component |
.vd-collection-action | Container for trailing actions like buttons or icons. | Sub-component |
Component API (Vue 3)
| Prop | Description |
|---|---|
:items | Array of { id, title, subtitle?, avatar?, action? }. |
:header | Optional list header text. |
:hoverable | Hover highlight on rows. |
:bordered | Adds an outer border. |
:size | sm | md | lg (default md). |