Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Data Table
- Date Picker
- Dialog
- Direction
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Kbd
- Label
- Menubar
- Native Select
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle
- Toggle Group
- Tooltip
- Typography
Get Started
No results found.
Suggestions
Calendar
Search Emoji
Calculator
Settings
Profile⌘P
Billing⌘B
Settings⌘S
import {
Command,
CommandEmpty,关于
<Command /> 组件基于 Dip 的 cmdk 组件。
安装
pnpm dlx shadcn@latest add command
用法
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from "@/components/ui/command"<Command className="max-w-sm rounded-lg border">
<CommandInput placeholder="输入命令或搜索..." />
<CommandList>
<CommandEmpty>未找到结果。</CommandEmpty>
<CommandGroup heading="建议">
<CommandItem>日历</CommandItem>
<CommandItem>搜索表情</CommandItem>
<CommandItem>计算器</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="设置">
<CommandItem>个人资料</CommandItem>
<CommandItem>账单</CommandItem>
<CommandItem>设置</CommandItem>
</CommandGroup>
</CommandList>
</Command>示例
基础
一个位于对话框中的简单命令菜单。
Command Palette
Search for a command to run...
"use client"
import * as React from "react"快捷键
Command Palette
Search for a command to run...
"use client"
import * as React from "react"分组
一个包含分组、图标和分隔线的命令菜单。
Command Palette
Search for a command to run...
"use client"
import * as React from "react"可滚动
一个包含多个项目、可滚动的命令菜单。
Command Palette
Search for a command to run...
"use client"
import * as React from "react"RTL
要在 shadcn/ui 中启用 RTL 支持,请参见 RTL 配置指南。
لم يتم العثور على نتائج.
اقتراحات
التقويم
البحث عن الرموز التعبيرية
الآلة الحاسبة
الإعدادات
الملف الشخصي⌘P
الفوترة⌘B
الإعدادات⌘S
"use client"
import * as React from "react"API 参考
更多信息请参见 cmdk 文档。