# 内容列表

- 页面: https://jiguang132.com/zh/resources/daisyui/docs/list
- 资源: daisyUI (https://jiguang132.com/zh/resources/daisyui.md)
- 全部指南: https://jiguang132.com/zh/resources/daisyui/docs.md

用 list-row 组织媒体、正文和操作，保持列表语义和阅读顺序。多列内容在窄屏使用换行类，行内操作不能让整行点击形成嵌套交互冲突。

## 安装与初始化

```bash
npm install -D tailwindcss@4.2.1 @tailwindcss/cli@4.2.1 daisyui@5.7.47
```

这是原生 CSS 插件，不是 React 组件导入。先用 Tailwind 4 和 daisyUI 插件生成并加载样式，再复制示例。完整步骤见随附安装指南；不要盲目覆盖宿主的 React 或 Tailwind 版本。

```css
@import "tailwindcss";
@plugin "daisyui" { themes: light --default, dark --prefersdark; }
```

## 源码与真实交互

源码文件保留原始代码块、注释和演示文字。$$ 类名前缀占位符需按你的插件配置处理：未配置前缀时，$$btn 改为 btn。复制所选示例列出的全部源文件，按框架组合 HTML、CSS、JavaScript 并保留原生事件。预览的已审查事件适配器不是后端，也不会随 npm 命令自动安装到你的应用。

## 首个完整示例

```html
<ul class="$$list bg-base-100 rounded-box shadow-md">
  
  <li class="p-4 pb-2 text-xs opacity-60 tracking-wide">Most played songs this week</li>
  
  <li class="$$list-row">
    <div><img class="size-10 rounded-box" alt="Tailwind CSS list item" src="https://img.daisyui.com/images/profile/demo/1@94.webp"/></div>
    <div>
      <div>Dio Lupa</div>
      <div class="text-xs uppercase font-semibold opacity-60">Remaining Reason</div>
    </div>
    <button class="$$btn $$btn-square $$btn-ghost">
      <svg aria-label="Play" class="size-[1.2em]" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g stroke-linejoin="round" stroke-linecap="round" stroke-width="2" fill="none" stroke="currentColor"><path d="M6 3L20 12 6 21 6 3z"></path></g></svg>
    </button>
    <button class="$$btn $$btn-square $$btn-ghost">
      <svg aria-label="Favorite" class="size-[1.2em]" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g stroke-linejoin="round" stroke-linecap="round" stroke-width="2" fill="none" stroke="currentColor"><path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"></path></g></svg>
    </button>
  </li>
  
  <li class="$$list-row">
    <div><img class="size-10 rounded-box" alt="Tailwind CSS list item" src="https://img.daisyui.com/images/profile/demo/4@94.webp"/></div>
    <div>
      <div>Ellie Beilish</div>
      <div class="text-xs uppercase font-semibold opacity-60">Bears of a fever</div>
    </div>
    <button class="$$btn $$btn-square $$btn-ghost">
      <svg aria-label="Play" class="size-[1.2em]" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g stroke-linejoin="round" stroke-linecap="round" stroke-width="2" fill="none" stroke="currentColor"><path d="M6 3L20 12 6 21 6 3z"></path></g></svg>
    </button>
    <button class="$$btn $$btn-square $$btn-ghost">
      <svg aria-label="Favorite" class="size-[1.2em]" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g stroke-linejoin="round" stroke-linecap="round" stroke-width="2" fill="none" stroke="currentColor"><path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"></path></g></svg>
    </button>
  </li>
  
  <li class="$$list-row">
    <div><img class="size-10 rounded-box" alt="Tailwind CSS list item" src="https://img.daisyui.com/images/profile/demo/3@94.webp"/></div>
    <div>
      <div>Sabrino Gardener</div>
      <div class="text-xs uppercase font-semibold opacity-60">Cappuccino</div>
    </div>
    <button class="$$btn $$btn-square $$btn-ghost">
      <svg aria-label="Play" class="size-[1.2em]" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g stroke-linejoin="round" stroke-linecap="round" stroke-width="2" fill="none" stroke="currentColor"><path d="M6 3L20 12 6 21 6 3z"></path></g></svg>
    </button>
    <button class="$$btn $$btn-square $$btn-ghost">
      <svg aria-label="Favorite" class="size-[1.2em]" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g stroke-linejoin="round" stroke-linecap="round" stroke-width="2" fill="none" stroke="currentColor"><path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"></path></g></svg>
    </button>
  </li>
  
</ul>
```

## 全部可运行示例

### 第二列扩展（默认）

`list-1`

```bash
npm install -D tailwindcss@4.2.1 @tailwindcss/cli@4.2.1 daisyui@5.7.47
```

- `examples/list/block-0.html`

### 第三列扩展

`list-2`

```bash
npm install -D tailwindcss@4.2.1 @tailwindcss/cli@4.2.1 daisyui@5.7.47
```

- `examples/list/block-1.html`

### 第三列换行

`list-3`

```bash
npm install -D tailwindcss@4.2.1 @tailwindcss/cli@4.2.1 daisyui@5.7.47
```

- `examples/list/block-2.html`

## 主题、无障碍与验证

使用原生 data-theme 主题边界。验证键盘、标签、可见焦点、适用的禁用／错误状态、深浅色、移动端和减少动画。检查目标浏览器的 dialog、popover 和 CSS 特性支持；类名不会补齐未实现的 JavaScript 或业务服务。卸载时清理计时器和第三方实例；复制命令不等于安装成功。

## 来源与许可证

https://github.com/saadeghi/daisyui/tree/c51f50130ffefb293179e6fce8de7ad3f307e45f

本页是 JGuang 编写的双语实用说明，不声称全文翻译上游文档。原始 Markdown、代码和 CSS 保留在源码查看器。保留 MIT 与各依赖独立声明；保守附上整个原生环境的许可，包括构建工具，但不分发构建二进制或远程演示图片。实际项目请替换为有使用权的素材，不包含商业模板。

---

JGuang 全部资源索引: https://jiguang132.com/llms.txt
