diff --git a/apps/docs/public/registry/index.json b/apps/docs/public/registry/index.json
index 5392f695..0bb4b41f 100644
--- a/apps/docs/public/registry/index.json
+++ b/apps/docs/public/registry/index.json
@@ -128,7 +128,8 @@
{
"name": "command",
"dependencies": [
- "@kobalte/core"
+ "@kobalte/core",
+ "cmdk-solid"
],
"registryDependencies": [
"dialog"
diff --git a/apps/docs/public/registry/ui/command.json b/apps/docs/public/registry/ui/command.json
index fe845a79..ac88718c 100644
--- a/apps/docs/public/registry/ui/command.json
+++ b/apps/docs/public/registry/ui/command.json
@@ -1,7 +1,8 @@
{
"name": "command",
"dependencies": [
- "@kobalte/core"
+ "@kobalte/core",
+ "cmdk-solid"
],
"registryDependencies": [
"dialog"
@@ -9,7 +10,7 @@
"files": [
{
"name": "command.tsx",
- "content": "import type { ComponentProps, VoidComponent, VoidProps } from \"solid-js\"\nimport { splitProps, type ParentComponent } from \"solid-js\"\n\nimport type { Dialog as DialogPrimitive } from \"@kobalte/core\"\nimport { Combobox as ComboboxPrimitive } from \"@kobalte/core\"\n\nimport { cn } from \"~/lib/utils\"\nimport { Dialog, DialogContent } from \"~/registry/ui/dialog\"\n\ntype CommandProps
-
- options={data}
- optionValue="value"
- optionTextValue="label"
- optionLabel="label"
- optionGroupChildren="options"
- placeholder="Type a command or search..."
- itemComponent={(props) => (
-
- {props.item.rawValue.icon}
- {props.item.rawValue.label}
- {props.item.rawValue.shortcut}
-
- )}
- sectionComponent={(props) => (
- {props.section.rawValue.label}
- )}
- open={open()}
- onOpenChange={setOpen}
- >
-
-
+
+
+
+ No results found.
+
+
+
+ Calendar
+
+
+
+ Search Emoji
+
+
+
+ Launch
+
+
+
+
+
+
+ Profile
+ ⌘P
+
+
+
+ Mail
+ ⌘B
+
+
+
+ Settings
+ ⌘S
+
+
+
>
)
diff --git a/apps/docs/src/registry/registry.ts b/apps/docs/src/registry/registry.ts
index daa6d6e8..1c9e4d42 100644
--- a/apps/docs/src/registry/registry.ts
+++ b/apps/docs/src/registry/registry.ts
@@ -80,7 +80,7 @@ const ui: Registry = [
{
name: "command",
type: "ui",
- dependencies: ["@kobalte/core"],
+ dependencies: ["@kobalte/core", "cmdk-solid"],
registryDependencies: ["dialog"],
files: ["ui/command.tsx"]
},
diff --git a/apps/docs/src/registry/ui/command.tsx b/apps/docs/src/registry/ui/command.tsx
index 22a64a83..1ed271cb 100644
--- a/apps/docs/src/registry/ui/command.tsx
+++ b/apps/docs/src/registry/ui/command.tsx
@@ -1,34 +1,26 @@
-import type { ComponentProps, VoidComponent, VoidProps } from "solid-js"
+import type { ComponentProps, VoidComponent } from "solid-js"
import { splitProps, type ParentComponent } from "solid-js"
import type { Dialog as DialogPrimitive } from "@kobalte/core"
-import { Combobox as ComboboxPrimitive } from "@kobalte/core"
+import {
+ CommandEmptyProps,
+ CommandGroupProps,
+ CommandInputProps,
+ CommandItemProps,
+ CommandListProps,
+ Command as CommandPrimitive,
+ CommandRootProps,
+ CommandSeparatorProps
+} from "cmdk-solid"
import { cn } from "~/lib/utils"
import { Dialog, DialogContent } from "~/registry/ui/dialog"
-type CommandProps = Omit<
- ComboboxPrimitive.ComboboxRootProps,
- | "open"
- | "defaultOpen"
- | "multiple"
- | "value"
- | "defaultValue"
- | "removeOnBackspace"
- | "readOnly"
- | "allowsEmptyCollection"
->
-
-const Command = (props: CommandProps) => {
+const Command: ParentComponent = (props) => {
const [local, rest] = splitProps(props, ["class"])
return (
- (props: CommandProps) => {
)
}
-const CommandInput: VoidComponent = (props) => {
+type CommandDialogProps = DialogPrimitive.DialogRootProps
+
+const CommandDialog: ParentComponent = (props) => {
+ const [local, rest] = splitProps(props, ["children"])
+
+ return (
+
+ )
+}
+
+const CommandInput: VoidComponent = (props) => {
const [local, rest] = splitProps(props, ["class"])
return (
-
+
)
}
-const CommandList = (
- props: VoidProps>
-) => {
+const CommandList: ParentComponent = (props) => {
const [local, rest] = splitProps(props, ["class"])
return (
-
)
}
-const CommandItem: ParentComponent = (props) => {
- const [local, rest] = splitProps(props, ["class", "item"])
+const CommandEmpty: ParentComponent = (props) => {
+ const [local, rest] = splitProps(props, ["class"])
+
+ return
+}
+
+const CommandGroup: ParentComponent = (props) => {
+ const [local, rest] = splitProps(props, ["class"])
return (
- = (props
)
}
-const CommandItemLabel = ComboboxPrimitive.ItemLabel
+const CommandSeparator: VoidComponent = (props) => {
+ const [local, rest] = splitProps(props, ["class"])
-const CommandHeading: ParentComponent = (props) => {
+ return
+}
+
+const CommandItem: ParentComponent = (props) => {
const [local, rest] = splitProps(props, ["class"])
return (
- =
)
}
-const CommandItemShortcut: ParentComponent> = (props) => {
+const CommandShortcut: ParentComponent> = (props) => {
const [local, rest] = splitProps(props, ["class"])
return (
@@ -126,33 +139,14 @@ const CommandItemShortcut: ParentComponent> = (props) =>
)
}
-type CommandDialogProps = DialogPrimitive.DialogRootProps &
- CommandProps
-
-const CommandDialog = (props: CommandDialogProps) => {
- const [local, rest] = splitProps(props, ["children"])
-
- return (
-
- )
-}
-
export {
Command,
+ CommandDialog,
CommandInput,
CommandList,
+ CommandEmpty,
+ CommandGroup,
CommandItem,
- CommandItemLabel,
- CommandItemShortcut,
- CommandHeading,
- CommandDialog
+ CommandShortcut,
+ CommandSeparator
}
diff --git a/apps/docs/src/routes/docs/components/command.mdx b/apps/docs/src/routes/docs/components/command.mdx
index 45dbf06b..ad5c9fdd 100644
--- a/apps/docs/src/routes/docs/components/command.mdx
+++ b/apps/docs/src/routes/docs/components/command.mdx
@@ -2,6 +2,10 @@
+## About
+
+The `` component uses the [`cmdk-solid`](https://cmdk-solid.vercel.app) component by [create-signal](https://github.com/create-signal/cmdk-solid).
+
## Installation
@@ -25,7 +29,7 @@ npx solidui-cli@latest add command
Install the following dependencies:
```bash
-npm install @kobalte/core
+npm install @kobalte/core cmdk-solid
```
Copy and paste the following code into your project:
@@ -42,28 +46,34 @@ npm install @kobalte/core
```tsx
import {
Command,
+ CommandDialog,
+ CommandEmpty,
+ CommandGroup,
CommandInput,
CommandItem,
- CommandItemLabel,
- CommandList
+ CommandList,
+ CommandSeparator,
+ CommandShortcut,
} from "@/components/ui/command"
```
```tsx
-const ALL_OPTIONS = ["Apple", "Banana", "Blueberry", "Grapes", "Pineapple"]
-```
-
-```tsx
- (
-
- {props.item.rawValue}
-
- )}
->
-
-
+
+
+
+ No results found.
+
+ Calendar
+ Search Emoji
+ Calculator
+
+
+
+ Profile
+ Billing
+ Settings
+
+
```
@@ -86,25 +96,25 @@ export function CommandMenu() {
setOpen((open) => !open)
}
}
-
+
document.addEventListener("keydown", down)
-
+
onCleanup(() => {
document.removeEventListener("keydown", down)
})
})
return (
- (
-
- {props.item.rawValue}
-
- )}
- >
-
-
+
+
+
+ No results found.
+
+ Calendar
+ Search Emoji
+ Calculator
+
+
)
}