Componentmedia0.99 KB gzipZero dependencies
VolumeSlider
Vertical or horizontal slider with fill animation, mute toggle, and ARIA roles
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add volume-sliderOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { VolumeSlider } from "@/components/ui/volume-slider" <VolumeSlider value={0.7} onValueChange={setVolume} />Source code
volume-slider.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxvolume-slider.tsx129 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface VolumeSliderProps { value?: number; defaultValue?: number; onValueChange: (value: number) => void; orientation?: "horizontal" | "vertical"; className?: string;} export function VolumeSlider({ value: controlledValue, defaultValue = 0.7, onValueChange, orientation = "horizontal",Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { VolumeSlider } from "@/components/ui/volume-slider"; <VolumeSlider />| Prop | Type | Description |
|---|---|---|
| value | number | Controlled value. |
| defaultValue | number | Initial value when uncontrolled. (Default: 0.7) |
| onValueChange | (value: number) => void | Callback invoked on value change. |
| orientation | "horizontal" | "vertical" | Layout and keyboard navigation axis. (Default: "horizontal") |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |