Button Group

Joins related buttons into a single segmented control.

<script lang="ts">
  import {
    ButtonGroup,
    ButtonGroupSeparator
  } from "$lib/components/ui/button-group";
  import { Button } from "$lib/components/ui/button";
</script>
 
<ButtonGroup>
  <Button variant="ghost">Day</Button>
  <ButtonGroupSeparator />
  <Button variant="ghost">Week</Button>
  <ButtonGroupSeparator />
  <Button variant="ghost">Month</Button>
</ButtonGroup>

Installation

npx lily-svelte@latest add button-group

Usage

<script lang="ts">
	import { ButtonGroup, ButtonGroupSeparator } from '$lib/components/ui/button-group';
	import { Button } from '$lib/components/ui/button';
</script>
 
<ButtonGroup>
	<Button variant="ghost">Day</Button>
	<ButtonGroupSeparator />
	<Button variant="ghost">Week</Button>
	<ButtonGroupSeparator />
	<Button variant="ghost">Month</Button>
</ButtonGroup>

Built by levish. The source code is available on GitHub.

Quiet by design.