budibase/packages/bbui/src/ButtonGroup/ButtonGroup.svelte

20 lines
426 B
Svelte
Raw Normal View History

2021-04-21 14:12:47 +02:00
<script>
import "@spectrum-css/buttongroup/dist/index-vars.css"
export let vertical = false
function group(element) {
const buttons = Array.from(element.getElementsByTagName("button"))
buttons.forEach((button) => {
button.classList.add("spectrum-ButtonGroup-item")
})
}
2021-04-21 14:12:47 +02:00
</script>
<div
use:group
class="spectrum-ButtonGroup"
class:spectrum-ButtonGroup--vertical={vertical}
>
<slot />
</div>