Utility
AI
Terminal
Installation
pnpm dlx shadcn@latest add https://termcn.dev/r/list.json
Usage
import { List } from "@/components/ui/list";<List
items={[
{ key: "ts", label: "TypeScript", description: "Typed JavaScript" },
{ key: "rs", label: "Rust", description: "Systems language" },
{ key: "go", label: "Go", description: "Cloud-native language" },
]}
onSelect={(item) => console.log(item.key)}
/>API Reference
List
| Prop | Type | Default |
|---|---|---|
items | ListItem[] | required |
onSelect | (item: ListItem) => void | undefined |
filterable | boolean | false |
height | number | 10 |
cursor | string | "›" |
ListItem
| Prop | Type | Default |
|---|---|---|
key | string | required |
label | string | required |
description | string | undefined |
color | string | undefined |