gradio/js/dropdown/Dropdown.stories.svelte
Hannah 6b8a7e5d36
Ensure gr.Dropdown can have an empty initial value (#7431)
* ensure dropdown can have empty value

* add changeset

* add changeset

* Add story

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-02-15 18:24:02 +01:00

61 lines
980 B
Svelte

<script lang="ts">
import { Meta, Template, Story } from "@storybook/addon-svelte-csf";
import Dropdown from "./shared/Dropdown.svelte";
</script>
<Meta
title="Components/Dropdown"
component={Dropdown}
argTypes={{
multiselect: {
control: [true, false],
description: "Whether to autoplay the video on load",
name: "multiselect",
value: false
}
}}
/>
<Template let:args>
<Dropdown {...args} />
</Template>
<Story
name="Single-select"
args={{
value: "swim",
choices: [
["run", "run"],
["swim", "swim"],
["jump", "jump"]
],
label: "Single-select Dropdown"
}}
/>
<Story
name="Single-select Static"
args={{
value: "swim",
choices: [
["run", "run"],
["swim", "swim"],
["jump", "jump"]
],
disabled: true,
label: "Single-select Dropdown"
}}
/>
<Story
name="Empty initial value"
args={{
interactive: true,
choices: [
["run", "run"],
["swim", "swim"],
["jump", "jump"]
],
label: "Empty Dropdown"
}}
/>