Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Card
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Dialog
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Kbd
- Label
- Native Select
- Pagination
- Popover
- Progress
- Radio Group
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle
- Toggle Group
- Tooltip
- Typography
Get Started
@shadcn/react
@shadcn/helpers
Force UI registry
Utilities
Installation#
pnpm dlx shadcn@latest add @force-ui-ember/combobox
Usage#
import { tracked } from '@glimmer/tracking';
import Component from '@glimmer/component';
import { Button } from '@/ui/button';
import {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
} from '@/ui/command';
import {
Popover,
PopoverContent,
PopoverTrigger,
} from '@/ui/popover';
const frameworks = [
{ value: 'next.js', label: 'Next.js' },
{ value: 'sveltekit', label: 'SvelteKit' },
{ value: 'nuxt.js', label: 'Nuxt.js' },
{ value: 'remix', label: 'Remix' },
{ value: 'astro', label: 'Astro' },
];
export default class ExampleCombobox extends Component {
@tracked open = false;
@tracked value = '';
get selectedLabel() {
const framework = frameworks.find((f) => f.value === this.value);
return framework?.label || 'Select framework...';
}
handleSelect = (currentValue: string) => {
this.value = currentValue === this.value ? '' : currentValue;
this.open = false;
};
<template>
<Popover @open={{this.open}} @onOpenChange={{(fn (mut this.open))}}>
<PopoverTrigger>
<Button
@variant="outline"
role="combobox"
aria-expanded={{this.open}}
@class="w-[200px] justify-between"
>
{{this.selectedLabel}}
</Button>
</PopoverTrigger>
<PopoverContent @class="w-[200px] p-0">
<Command>
<CommandInput @placeholder="Search framework..." />
<CommandList>
<CommandEmpty>No framework found.</CommandEmpty>
<CommandGroup>
{{#each frameworks as |framework|}}
<CommandItem
@value={{framework.value}}
@onSelect={{this.handleSelect}}
>
{{framework.label}}
</CommandItem>
{{/each}}
</CommandGroup>
</CommandList>
</Command>
</PopoverContent>
</Popover>
</template>
}Examples#
Basic#
A simple combobox with a list of frameworks.
Popup#
Use Command inside a Popover to trigger a combobox from a button.
Dropdown Menu#
You can compose a combobox inside a DropdownMenu.
Responsive#
You can create a responsive combobox by using the Popover on desktop and the Sheet on mobile.
API Reference#
See the Ember Force UI documentation for more information.
Deploy your shadcn/ui app on Vercel
Trusted by OpenAI, Sonos, Adobe, and more.
Vercel provides tools and infrastructure to deploy apps and features at scale.
Deploy to Vercel