gradio/ui/packages/app/src/components/Radio/Radio.svelte

24 lines
515 B
Svelte
Raw Normal View History

<script lang="ts">
2022-03-08 21:35:42 +08:00
import { Radio } from "@gradio/form";
export let label: string = "Radio";
2022-03-12 00:00:48 +08:00
export let value: string = "";
2022-03-29 21:10:35 +08:00
export let default_value: string;
export let style: string = "";
2022-03-12 00:00:48 +08:00
export let choices: Array<string> = [];
export let mode: "static" | "dynamic";
export let form_position: "first" | "last" | "mid" | "single" = "single";
2022-03-29 21:10:35 +08:00
if (default_value) value = default_value;
</script>
<Radio
{form_position}
bind:value
{label}
{style}
{choices}
disabled={mode === "static"}
on:change
/>