组件
- 手风琴
- 警报
- 警报对话框
- 纵横比
- 头像
- 徽章
- 面包屑
- 按钮
- 按钮组
- 日历
- 卡片
- 轮播
- 图表
- 复选框
- 可折叠
- 组合框
- 命令
- 上下文菜单
- 数据表格
- 日期选择器
- 对话框
- 方向
- 抽屉
- 下拉菜单
- 空
- 字段
- 悬停卡
- 输入
- 输入组
- 输入 OTP
- 条目
- 键盘
- 标签
- 菜单栏
- 原生选择
- 导航菜单
- 分页
- 弹出窗口
- 进度
- 单选按钮组
- 可调整大小
- 滚动区域
- 选择
- 分隔符
- 工作表
- 侧边栏
- 骨架
- 滑块
- Sonner
- 旋转器
- 切换
- 表格
- 标签
- 文本区域
- Toast
- 切换
- 切换组
- 工具提示
- 排版
- 手风琴
- 警报
- 警报对话框
- 纵横比
- 头像
- 徽章
- 面包屑
- 按钮
- 按钮组
- 日历
- 卡片
- 轮播
- 图表
- 复选框
- 可折叠
- 组合框
- 命令
- 上下文菜单
- 数据表格
- 日期选择器
- 对话框
- 方向
- 抽屉
- 下拉菜单
- 空
- 字段
- 悬停卡
- 输入
- 输入组
- 输入 OTP
- 条目
- 键盘
- 标签
- 菜单栏
- 原生选择
- 导航菜单
- 分页
- 弹出窗口
- 进度
- 单选按钮组
- 可调整大小
- 滚动区域
- 选择
- 分隔符
- 工作表
- 侧边栏
- 骨架
- 滑块
- Sonner
- 旋转器
- 切换
- 表格
- 标签
- 文本区域
- Toast
- 切换
- 切换组
- 工具提示
- 排版
No results found.
Suggestions
Calendar
Search Emoji
Calculator
Settings
Profile⌘P
Billing⌘B
Settings⌘S
import {
Command,
CommandEmpty,关于
🌐 About
<Command /> 组件通过 Dip 使用 cmdk 组件。
🌐 The <Command /> component uses the cmdk component by Dip.
安装
🌐 Installation
pnpm dlx shadcn@latest add command
用法
🌐 Usage
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from "@/components/ui/command"<Command className="max-w-sm rounded-lg border">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem>Calendar</CommandItem>
<CommandItem>Search Emoji</CommandItem>
<CommandItem>Calculator</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem>Profile</CommandItem>
<CommandItem>Billing</CommandItem>
<CommandItem>Settings</CommandItem>
</CommandGroup>
</CommandList>
</Command>示例
🌐 Examples
基础
🌐 Basic
对话中的一个简单命令菜单。
🌐 A simple command menu in a dialog.
Command Palette
Search for a command to run...
"use client"
import * as React from "react"快捷方式
🌐 Shortcuts
Command Palette
Search for a command to run...
"use client"
import * as React from "react"群组
🌐 Groups
一个带有分组、图标和分隔符的命令菜单。
🌐 A command menu with groups, icons and separators.
Command Palette
Search for a command to run...
"use client"
import * as React from "react"可滚动
🌐 Scrollable
带有多个项目的可滚动命令菜单。
🌐 Scrollable command menu with multiple items.
Command Palette
Search for a command to run...
"use client"
import * as React from "react"从右到左
🌐 RTL
要在 shadcn/ui 中启用 RTL 支持,请参阅 RTL 配置指南。
🌐 To enable RTL support in shadcn/ui, see the RTL configuration guide.
لم يتم العثور على نتائج.
اقتراحات
التقويم
البحث عن الرموز التعبيرية
الآلة الحاسبة
الإعدادات
الملف الشخصي⌘P
الفوترة⌘B
الإعدادات⌘S
"use client"
import * as React from "react"API参考
🌐 API Reference
有关更多信息,请参见 cmdk 文档。
🌐 See the cmdk documentation for more information.