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

31 lines
631 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"
2021-07-05 11:19:27 +02:00
export let quiet = false
2019-08-19 22:18:23 +02:00
</script>
<button
class={`spectrum-Button spectrum-Button--size${size} spectrum-Button--${type}`}
2021-07-05 11:19:27 +02:00
class:spectrum-Button--quiet={quiet}
disabled={disabled || false}
use:styleable={$component.styles}
on:click={onClick}
>
{text || ""}
</button>
<style>
button {
width: fit-content;
width: -moz-fit-content;
}
</style>