Skip to main content
Version: v1 (Current)

Command

Generated from public Vue/TypeScript exports by pnpm docs:generate. Edit source comments and stories to update this reference. Types describe the declared API; browser/device constraints are covered in the guides. This catalog reflects source commit fc6bfb108634735f1657e533206c3f8702ad357d; match your installed package and typed manifest before using an export. Source review does not establish registry-release availability.

Command​

import { Command } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
modelValueAcceptableValue | AcceptableValue[] | undefined""The controlled value of the listbox. Can be binded with v-model.
defaultValueAcceptableValue | AcceptableValue[] | undefined—The value of the listbox when initially rendered. Use when you do not need to control the state of the Listbox
multipleboolean | undefined—Whether multiple options can be selected or not.
orientationDataOrientation | undefined—The orientation of the listbox. <br>Mainly so arrow navigation is done accordingly (left & right vs. up & down)
dirDirection | undefined—The reading direction of the listbox when applicable. <br> If omitted, inherits globally from ConfigProvider or assumes LTR (left-to-right) reading mode.
disabledboolean | undefined—When true, prevents the user from interacting with listbox
selectionBehavior"toggle" | "replace" | undefined—How multiple selection should behave in the collection.
highlightOnHoverboolean | undefined—When true, hover over item will trigger highlight
bystring | ((a: AcceptableValue, b: AcceptableValue) => boolean) | undefined—Use this to compare objects by a particular field, or pass your own comparison function for complete control over how objects are compared.
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.
namestring | undefined—The name of the field. Submitted with its owning form as part of a name/value pair.
requiredboolean | undefined—When true, indicates that the user must set the value before the owning form can be submitted.

Events​

NameTypeRequired / defaultDescription
update:modelValue[value: AcceptableValue]——
entryFocus[event: CustomEvent<any>]——
highlight[payload: { ref: HTMLElement; value: AcceptableValue; } | undefined]——
leave[event: Event]——

Slots​

NameTypeRequired / defaultDescription
default{}——

Examples​

These are authored Storybook excerpts, not complete standalone modules. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
render: () => ({
components: {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
template: `
<Command class="rounded-lg border shadow-md w-[400px]">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</Command>
`,
}),
}

InDialog​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
name: 'In Dialog',
render: () => ({
components: {
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Button,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
setup() {
const open = ref(false)
return { open }
},
template: `
<div>
<p class="text-sm text-muted-foreground mb-4">
Press <kbd class="pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100">Cmd+K</kbd> or click the button below.
</p>
<Button variant="outline" @click="open = true">Open Command Palette</Button>
<CommandDialog v-model:open="open">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</CommandDialog>
</div>
`,
}),
}

Showcase​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
name: 'Showcase',
render: () => ({
components: {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Button,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
setup() {
const dialogOpen = ref(false)
return { dialogOpen }
},
template: `
<div class="space-y-8">
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Inline Command</h3>
<Command class="rounded-lg border shadow-md w-[400px]">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</Command>
</div>

<div>
<h3 class="text-lg font-semibold mb-4 text-white">Command Dialog</h3>
<Button variant="outline" @click="dialogOpen = true">Open Command Palette</Button>
<CommandDialog v-model:open="dialogOpen">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</CommandDialog>
</div>
</div>
`,
}),
}

CommandDialog​

import { CommandDialog } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
openboolean | undefined—The controlled open state of the dialog. Can be binded as v-model:open.
defaultOpenboolean | undefined—The open state of the dialog when it is initially rendered. Use when you do not need to control its open state.
modalboolean | undefined—The modality of the dialog When set to true, <br> interaction with outside elements will be disabled and only dialog content will be visible to screen readers.
unmountOnHideboolean | undefined—When set to false, the dialog content will not be unmounted when closed, but instead hidden with CSS. <br> Useful for SEO or when you want to improve performance by not remounting the component on every open.

Events​

NameTypeRequired / defaultDescription
update:open[value: boolean]——

Slots​

NameTypeRequired / defaultDescription
default{}——

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

InDialog​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
name: 'In Dialog',
render: () => ({
components: {
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Button,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
setup() {
const open = ref(false)
return { open }
},
template: `
<div>
<p class="text-sm text-muted-foreground mb-4">
Press <kbd class="pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100">Cmd+K</kbd> or click the button below.
</p>
<Button variant="outline" @click="open = true">Open Command Palette</Button>
<CommandDialog v-model:open="open">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</CommandDialog>
</div>
`,
}),
}

Showcase​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
name: 'Showcase',
render: () => ({
components: {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Button,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
setup() {
const dialogOpen = ref(false)
return { dialogOpen }
},
template: `
<div class="space-y-8">
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Inline Command</h3>
<Command class="rounded-lg border shadow-md w-[400px]">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</Command>
</div>

<div>
<h3 class="text-lg font-semibold mb-4 text-white">Command Dialog</h3>
<Button variant="outline" @click="dialogOpen = true">Open Command Palette</Button>
<CommandDialog v-model:open="dialogOpen">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</CommandDialog>
</div>
</div>
`,
}),
}

CommandEmpty​

import { CommandEmpty } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Slots​

NameTypeRequired / defaultDescription
default{}——

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
render: () => ({
components: {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
template: `
<Command class="rounded-lg border shadow-md w-[400px]">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</Command>
`,
}),
}

InDialog​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
name: 'In Dialog',
render: () => ({
components: {
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Button,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
setup() {
const open = ref(false)
return { open }
},
template: `
<div>
<p class="text-sm text-muted-foreground mb-4">
Press <kbd class="pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100">Cmd+K</kbd> or click the button below.
</p>
<Button variant="outline" @click="open = true">Open Command Palette</Button>
<CommandDialog v-model:open="open">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</CommandDialog>
</div>
`,
}),
}

Showcase​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
name: 'Showcase',
render: () => ({
components: {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Button,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
setup() {
const dialogOpen = ref(false)
return { dialogOpen }
},
template: `
<div class="space-y-8">
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Inline Command</h3>
<Command class="rounded-lg border shadow-md w-[400px]">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</Command>
</div>

<div>
<h3 class="text-lg font-semibold mb-4 text-white">Command Dialog</h3>
<Button variant="outline" @click="dialogOpen = true">Open Command Palette</Button>
<CommandDialog v-model:open="dialogOpen">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</CommandDialog>
</div>
</div>
`,
}),
}

CommandGroup​

import { CommandGroup } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.
headingstring | undefined——

Slots​

NameTypeRequired / defaultDescription
default{}——

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
render: () => ({
components: {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
template: `
<Command class="rounded-lg border shadow-md w-[400px]">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</Command>
`,
}),
}

InDialog​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
name: 'In Dialog',
render: () => ({
components: {
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Button,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
setup() {
const open = ref(false)
return { open }
},
template: `
<div>
<p class="text-sm text-muted-foreground mb-4">
Press <kbd class="pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100">Cmd+K</kbd> or click the button below.
</p>
<Button variant="outline" @click="open = true">Open Command Palette</Button>
<CommandDialog v-model:open="open">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</CommandDialog>
</div>
`,
}),
}

Showcase​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
name: 'Showcase',
render: () => ({
components: {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Button,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
setup() {
const dialogOpen = ref(false)
return { dialogOpen }
},
template: `
<div class="space-y-8">
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Inline Command</h3>
<Command class="rounded-lg border shadow-md w-[400px]">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</Command>
</div>

<div>
<h3 class="text-lg font-semibold mb-4 text-white">Command Dialog</h3>
<Button variant="outline" @click="dialogOpen = true">Open Command Palette</Button>
<CommandDialog v-model:open="dialogOpen">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</CommandDialog>
</div>
</div>
`,
}),
}

CommandInput​

import { CommandInput } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
modelValuestring | undefined—The controlled value of the filter. Can be binded with v-model.
autoFocusboolean | undefined—Focus on element when mounted.
disabledboolean | undefined—When true, prevents the user from interacting with item
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
render: () => ({
components: {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
template: `
<Command class="rounded-lg border shadow-md w-[400px]">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</Command>
`,
}),
}

InDialog​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
name: 'In Dialog',
render: () => ({
components: {
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Button,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
setup() {
const open = ref(false)
return { open }
},
template: `
<div>
<p class="text-sm text-muted-foreground mb-4">
Press <kbd class="pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100">Cmd+K</kbd> or click the button below.
</p>
<Button variant="outline" @click="open = true">Open Command Palette</Button>
<CommandDialog v-model:open="open">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</CommandDialog>
</div>
`,
}),
}

Showcase​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
name: 'Showcase',
render: () => ({
components: {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Button,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
setup() {
const dialogOpen = ref(false)
return { dialogOpen }
},
template: `
<div class="space-y-8">
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Inline Command</h3>
<Command class="rounded-lg border shadow-md w-[400px]">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</Command>
</div>

<div>
<h3 class="text-lg font-semibold mb-4 text-white">Command Dialog</h3>
<Button variant="outline" @click="dialogOpen = true">Open Command Palette</Button>
<CommandDialog v-model:open="dialogOpen">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</CommandDialog>
</div>
</div>
`,
}),
}

CommandItem​

import { CommandItem } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
valueAcceptableValueRequiredThe value given as data when submitted with a name.
disabledboolean | undefined—When true, prevents the user from interacting with the item.
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Events​

NameTypeRequired / defaultDescription
select[event: SelectEvent$3<AcceptableValue>]——

Slots​

NameTypeRequired / defaultDescription
default{}——

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
render: () => ({
components: {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
template: `
<Command class="rounded-lg border shadow-md w-[400px]">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</Command>
`,
}),
}

InDialog​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
name: 'In Dialog',
render: () => ({
components: {
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Button,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
setup() {
const open = ref(false)
return { open }
},
template: `
<div>
<p class="text-sm text-muted-foreground mb-4">
Press <kbd class="pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100">Cmd+K</kbd> or click the button below.
</p>
<Button variant="outline" @click="open = true">Open Command Palette</Button>
<CommandDialog v-model:open="open">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</CommandDialog>
</div>
`,
}),
}

Showcase​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
name: 'Showcase',
render: () => ({
components: {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Button,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
setup() {
const dialogOpen = ref(false)
return { dialogOpen }
},
template: `
<div class="space-y-8">
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Inline Command</h3>
<Command class="rounded-lg border shadow-md w-[400px]">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</Command>
</div>

<div>
<h3 class="text-lg font-semibold mb-4 text-white">Command Dialog</h3>
<Button variant="outline" @click="dialogOpen = true">Open Command Palette</Button>
<CommandDialog v-model:open="dialogOpen">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</CommandDialog>
</div>
</div>
`,
}),
}

CommandList​

import { CommandList } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Slots​

NameTypeRequired / defaultDescription
default{}——

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
render: () => ({
components: {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
template: `
<Command class="rounded-lg border shadow-md w-[400px]">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</Command>
`,
}),
}

InDialog​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
name: 'In Dialog',
render: () => ({
components: {
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Button,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
setup() {
const open = ref(false)
return { open }
},
template: `
<div>
<p class="text-sm text-muted-foreground mb-4">
Press <kbd class="pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100">Cmd+K</kbd> or click the button below.
</p>
<Button variant="outline" @click="open = true">Open Command Palette</Button>
<CommandDialog v-model:open="open">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</CommandDialog>
</div>
`,
}),
}

Showcase​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
name: 'Showcase',
render: () => ({
components: {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Button,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
setup() {
const dialogOpen = ref(false)
return { dialogOpen }
},
template: `
<div class="space-y-8">
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Inline Command</h3>
<Command class="rounded-lg border shadow-md w-[400px]">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</Command>
</div>

<div>
<h3 class="text-lg font-semibold mb-4 text-white">Command Dialog</h3>
<Button variant="outline" @click="dialogOpen = true">Open Command Palette</Button>
<CommandDialog v-model:open="dialogOpen">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</CommandDialog>
</div>
</div>
`,
}),
}

CommandSeparator​

import { CommandSeparator } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
orientationDataOrientation | undefined—Orientation of the component. Either vertical or horizontal. Defaults to horizontal.
decorativeboolean | undefined—Whether or not the component is purely decorative. <br>When true, accessibility-related attributes are updated so that that the rendered element is removed from the accessibility tree.
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Slots​

NameTypeRequired / defaultDescription
default{}——

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
render: () => ({
components: {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
template: `
<Command class="rounded-lg border shadow-md w-[400px]">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</Command>
`,
}),
}

InDialog​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
name: 'In Dialog',
render: () => ({
components: {
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Button,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
setup() {
const open = ref(false)
return { open }
},
template: `
<div>
<p class="text-sm text-muted-foreground mb-4">
Press <kbd class="pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100">Cmd+K</kbd> or click the button below.
</p>
<Button variant="outline" @click="open = true">Open Command Palette</Button>
<CommandDialog v-model:open="open">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</CommandDialog>
</div>
`,
}),
}

Showcase​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
name: 'Showcase',
render: () => ({
components: {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Button,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
setup() {
const dialogOpen = ref(false)
return { dialogOpen }
},
template: `
<div class="space-y-8">
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Inline Command</h3>
<Command class="rounded-lg border shadow-md w-[400px]">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</Command>
</div>

<div>
<h3 class="text-lg font-semibold mb-4 text-white">Command Dialog</h3>
<Button variant="outline" @click="dialogOpen = true">Open Command Palette</Button>
<CommandDialog v-model:open="dialogOpen">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</CommandDialog>
</div>
</div>
`,
}),
}

CommandShortcut​

import { CommandShortcut } from '@gxp-dev/app-ui'

Repository source

Slots​

NameTypeRequired / defaultDescription
default{}——

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
render: () => ({
components: {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
template: `
<Command class="rounded-lg border shadow-md w-[400px]">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</Command>
`,
}),
}

InDialog​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
name: 'In Dialog',
render: () => ({
components: {
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Button,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
setup() {
const open = ref(false)
return { open }
},
template: `
<div>
<p class="text-sm text-muted-foreground mb-4">
Press <kbd class="pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100">Cmd+K</kbd> or click the button below.
</p>
<Button variant="outline" @click="open = true">Open Command Palette</Button>
<CommandDialog v-model:open="open">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</CommandDialog>
</div>
`,
}),
}

Showcase​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-vue-next'
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '.'
import { Button } from '../button'
{
name: 'Showcase',
render: () => ({
components: {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
Button,
Calendar,
Smile,
Calculator,
User,
CreditCard,
Settings,
},
setup() {
const dialogOpen = ref(false)
return { dialogOpen }
},
template: `
<div class="space-y-8">
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Inline Command</h3>
<Command class="rounded-lg border shadow-md w-[400px]">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
<CommandItem value="calculator">
<Calculator class="mr-2" />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="billing">
<CreditCard class="mr-2" />
<span>Billing</span>
<CommandShortcut>Cmd+B</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</Command>
</div>

<div>
<h3 class="text-lg font-semibold mb-4 text-white">Command Dialog</h3>
<Button variant="outline" @click="dialogOpen = true">Open Command Palette</Button>
<CommandDialog v-model:open="dialogOpen">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem value="calendar">
<Calendar class="mr-2" />
<span>Calendar</span>
</CommandItem>
<CommandItem value="search-emoji">
<Smile class="mr-2" />
<span>Search Emoji</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem value="profile">
<User class="mr-2" />
<span>Profile</span>
<CommandShortcut>Cmd+P</CommandShortcut>
</CommandItem>
<CommandItem value="settings">
<Settings class="mr-2" />
<span>Settings</span>
<CommandShortcut>Cmd+S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</CommandDialog>
</div>
</div>
`,
}),
}