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

28 lines
476 B
Svelte
Raw Normal View History

<script lang="ts">
2022-03-08 21:35:42 +08:00
import { Range } from "@gradio/form";
2022-03-12 00:00:48 +08:00
export let value: number = 0;
2022-03-29 21:10:35 +08:00
export let label: string;
2022-03-29 21:10:35 +08:00
export let default_value: number;
export let style: string = "";
export let minimum: number;
export let maximum: number;
export let step: number;
2022-03-12 00:00:48 +08:00
export let mode: "static" | "dynamic";
2022-03-29 21:10:35 +08:00
if (default_value) value = default_value;
</script>
2022-03-12 00:00:48 +08:00
<Range
bind:value
{label}
{style}
2022-03-12 00:00:48 +08:00
{minimum}
{maximum}
{step}
disabled={mode === "static"}
on:change
/>