# Volume controller with plus/minus actions

> Volume controller with plus/minus actions

A shadcn/ui block from the [@reui](https://reui.io) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/reui/c-button-group-28).

- Page, with a live preview: https://shadcn.exchange/r/reui/c-button-group-28
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/reui/c-button-group-28-light-5cfbfdee3c987c19.png
- Registry item: https://reui.io/r/new-york-v4/c-button-group-28.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://reui.io/r/new-york-v4/c-button-group-28.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `button`, `button-group`

## Files

### `c-button-group-28.tsx`

```tsx
"use client"

import { useState } from "react"

import { Button } from "@/components/ui/button"
import { ButtonGroup } from "@/components/ui/button-group"
import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder"

export function Pattern() {
  const [volume, setVolume] = useState(50)
  const [isMuted, setIsMuted] = useState(false)

  const increaseVolume = () => {
    setVolume((prev) => Math.min(prev + 5, 100))
    setIsMuted(false)
  }

  const decreaseVolume = () => {
    setVolume((prev) => {
      const next = Math.max(prev - 5, 0)
      if (next === 0) setIsMuted(true)
      return next
    })
  }

  const toggleMute = () => {
    setIsMuted((prev) => !prev)
  }

  return (
    <ButtonGroup>
      <Button
        onClick={decreaseVolume}
        size="sm"
        variant="outline"
        aria-label="Decrease Volume"
      >
        <IconPlaceholder
          lucide="MinusIcon"
          tabler="IconMinus"
          hugeicons="MinusSignIcon"
          phosphor="MinusIcon"
          remixicon="RiSubtractLine"
          aria-hidden="true"
        />
      </Button>
      <Button
        onClick={toggleMute}
        size="sm"
        variant="outline"
        className="min-w-20"
      >
        {isMuted ? "Muted" : `${volume}%`}
      </Button>
      <Button
        onClick={increaseVolume}
        size="sm"
        variant="outline"
        aria-label="Increase Volume"
      >
        <IconPlaceholder
          lucide="PlusIcon"
          tabler="IconPlus"
          hugeicons="PlusSignIcon"
          phosphor="PlusIcon"
          remixicon="RiAddLine"
          aria-hidden="true"
        />
      </Button>
    </ButtonGroup>
  )
}
```
