mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-08 04:55:06 +09:00
Add a combobox story
This commit is contained in:
1 parent
2c64577c5e
commit
620cc351bb
1 file changed
+24
@@ -0,0 +1,24 @@
|
||||
import { ComponentStory } from "@storybook/react";
|
||||
import React from "react";
|
||||
import { Combobox } from "~/shared/design-system";
|
||||
|
||||
export default {
|
||||
component: Combobox,
|
||||
};
|
||||
|
||||
export const Simple: ComponentStory<typeof Combobox> = () => {
|
||||
const options = [
|
||||
{ label: "Apple" },
|
||||
{ label: "Banana" },
|
||||
{ label: "Orange" },
|
||||
];
|
||||
const [value, setValue] = React.useState(options[0]);
|
||||
return (
|
||||
<Combobox
|
||||
name="fruit"
|
||||
items={options}
|
||||
value={value}
|
||||
onValueChange={setValue}
|
||||
/>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user