Files
tabler/shared/ui/ButtonGroup.astro
T

25 lines
575 B
Plaintext

---
// Button group container (.btn-group / .btn-group-vertical).
interface Props {
/** use .btn-group-vertical instead of .btn-group */
vertical?: boolean;
/** btn-group-{size}: sm | lg | xl */
size?: string;
class?: string;
role?: string;
/** remaining attributes (aria-label, …) are forwarded */
[key: string]: unknown;
}
const { vertical, size, class: className, role = 'group', ...rest } = Astro.props;
---
<div
class:list={[vertical ? 'btn-group-vertical' : 'btn-group', size && `btn-group-${size}`, className]}
role={role}
{...rest}
>
<slot />
</div>