gradio/js/button/static/StaticButton.svelte
Hannah 37caa2e0fe
Add icon and link params to gr.Button (#5080)
* add icons and link params

* tweak

* add changeset

* prepend icon param with /file=

* prepend icon with /file=

* restore and add button stories

* add changeset

* param description tweak

* tweak param description

* type tweak

* fix i18n in story

* fix formatting

* fix test

* tweak

* fix typo

* fix icon bug

* fix inconsistent width

* remove <a /> target

* styling changes + add story

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-08-04 17:47:20 +02:00

34 lines
738 B
Svelte

<script lang="ts">
import Button from "./Button.svelte";
import { _ } from "svelte-i18n";
export let elem_id = "";
export let elem_classes: string[] = [];
export let visible = true;
export let value: string;
export let variant: "primary" | "secondary" | "stop" = "secondary";
export let mode: "static" | "dynamic" = "dynamic";
export let size: "sm" | "lg" = "lg";
export let scale: number | null = null;
export let icon: string | null = null;
export let link: string | null = null;
export let min_width: number | undefined = undefined;
</script>
<Button
{value}
{variant}
{elem_id}
{elem_classes}
{size}
{scale}
{link}
{icon}
{min_width}
{visible}
disabled={mode === "static"}
on:click
>
{$_(value)}
</Button>