/* Copyright 2026 Marimo. All rights reserved. */
import { Combobox, ComboboxItem } from "../components/ui/combobox";
export default {
title: "Combobox",
component: Combobox,
};
interface Framework {
value: string;
label: string;
}
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",
},
] satisfies Framework[];
export const Basic = () => (
framework.label}
>
{frameworks.map((framework) => (
{framework.label}
))}
);
export const Multiple = () => (
framework.label}
multiple={true}
>
{frameworks.map((framework) => (
{framework.label}
))}
);
export const MultipleWithChips = () => (
framework.label}
multiple={true}
chips={true}
keepPopoverOpenOnSelect={true}
>
{frameworks.map((framework) => (
{framework.label}
))}
);
const OPTIONS = [
"Apple",
"Banana",
"Blueberry",
"Grapes",
"Pineapple",
"Aubergine",
"Broccoli",
"Carrot",
"Courgette",
"Leek",
"Beef",
"Chicken",
"Lamb",
"Pork",
] as const;
export const Large = () => (
option}
multiple={true}
>
{OPTIONS.map((option) => (
{option}
))}
);
export const WithCustomFilterFn = () => (
framework.label}
filterFn={(value, search) => (value.startsWith(search) ? 1 : 0)}
>
{frameworks.map((framework) => (
{framework.label}
))}
);