Foundations
Icons
Actions
Buttons
Form Controls
Input
Text Area
Select Dropdown
Filter Dropdown
Checkbox
Radio Button
Switch
File Uploader
Color Picker
Multi Select
Search Input
Slider
OTP Input
Date Picker
Time Picker
Date Range Picker
Data Display
Table
Pagination
Progress Bar
Stat Card
Circular Progress
Navigation
Side Menu
Menu Bar
Tabs
Breadcrumb
Ellipsis
Content & Layout
Card
Divider
Banner
Carousel
Accordion
Timeline
Stepper
List
Overlays
Modal
Drawer
Popover
Command Palette
Dropdown Menu
Context Menu
Indicators
Tags
Chips
Badge
Avatar
Avatar Group
Tooltip
Skeleton
Spinner
Feedback
Snackbar
Alert
Callout
State
Command Palette
booleanWhether the palette is showing. Controlled: open it from your own shortcut, close it from onClose.
—ICommandItem[]Commands as { id, label, onSelect, description?, icon?, group?, shortcut? }. Items with the same group are listed together.
—stringHint in the search field.
"Type a command or search..."stringShown when nothing matches the search.
"No results found."() => voidCalled on Escape, a click outside, or after a command runs.
—stringExtra classes on the palette panel.
""import { Button, useState } from "react";
import {
Button,
CommandPalette,
AddSVG,
DashboardSVG,
SettingsSVG,
SignOutSVG,
} from "gwan-design-system";
const items = [
{
id: "new",
label: "New project",
icon: <AddSVG />,
group: "Actions",
shortcut: ["⌘", "N"],
onSelect: () => {},
},
{
id: "dash",
label: "Go to dashboard",
icon: <DashboardSVG />,
group: "Navigation",
onSelect: () => {},
},
{
id: "settings",
label: "Settings",
description: "Profile, billing and team",
icon: <SettingsSVG />,
group: "Navigation",
shortcut: ["⌘", ","],
onSelect: () => {},
},
{
id: "out",
label: "Sign out",
icon: <SignOutSVG />,
group: "Account",
onSelect: () => {},
},
];
const Example = () => {
const [open, setOpen] = useState(false);
return (
<>
<Button label="Open command palette" onClick={() => setOpen(true)} />
<CommandPalette
open={open}
items={items}
onClose={() => setOpen(false)}
/>
</>
);
};