@freedomcore/button-group-fc
v0.2.1
Published
Button grouping component with toggle and multi-select modes
Downloads
21
Maintainers
Readme
@freedomcore/button-group-fc
Button grouping component with toggle and multi-select modes.
Installation
npm install @freedomcore/button-group-fc @freedomcore/button-fcUsage
<link rel="stylesheet" href="node_modules/@freedomcore/button-fc/button-fc.css">
<link rel="stylesheet" href="node_modules/@freedomcore/button-group-fc/button-group-fc.css">
<!-- Toggle group (single selection) -->
<button-group-fc mode="toggle" value="left">
<button-fc value="left">Left</button-fc>
<button-fc value="center">Center</button-fc>
<button-fc value="right">Right</button-fc>
</button-group-fc>
<!-- Multi-select group -->
<button-group-fc mode="multi">
<button-fc value="bold">B</button-fc>
<button-fc value="italic">I</button-fc>
<button-fc value="underline">U</button-fc>
</button-group-fc>
<script type="module">
import '@freedomcore/button-fc';
import '@freedomcore/button-group-fc';
</script>Attributes
| Attribute | Values | Description |
|-----------|--------|-------------|
| mode | toggle, multi | Selection behavior |
| value | string | Current selection (toggle mode) |
Events
group.addEventListener('change', (e) => {
console.log('Selected:', e.detail.value);
});License
MIT © FreedomCore
