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

15 lines
444 B
Svelte

<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')
})
}
</script>
<div use:group class="spectrum-ButtonGroup" class:spectrum-ButtonGroup--vertical={vertical}>
<slot />
</div>