budibase/packages/standard-components/src/Button.svelte

22 lines
479 B
Svelte
Raw Normal View History

2019-08-19 22:18:23 +02:00
<script>
import { getContext } from "svelte"
const { styleable } = getContext("sdk")
const component = getContext("component")
2020-02-03 10:50:30 +01:00
export let disabled = false
export let text = ""
export let onClick
export let size = "M"
export let type = "primary"
2019-08-19 22:18:23 +02:00
</script>
<button
class={`spectrum-Button spectrum-Button--size${size} spectrum-Button--${type}`}
disabled={disabled || false}
use:styleable={$component.styles}
on:click={onClick}
>
{text || ""}
</button>