MediaVolumeControl

Media
stable

Mute / unmute toggle button with a vertical volume scrubber shown in a tooltip on hover.

Structure

Anatomy

Visual breakdown of the component's internal structure with BEM class call-outs.

Anatomy of OrigamMediaVolumeControlSchematic of the MediaVolumeControl component with 4 numbered internal parts. icon 1 2 3 4 origam-tooltip
Anatomy of <origam-media-volume-control> — 4 internal parts: the tooltip wrapper ①, the icon-only toggle button ②, the tooltip volume wrapper ③, and the vertical scrubber ④.
1.origam-media-volume-control__btn
Icon-only <button> that triggers mute/unmute. Styled with all: unset and rounded with border-radius: 50%.
2.origam-icon (within __btn)
Volume icon that switches between VOLUME_OFF / VOLUME_LOW / VOLUME_MEDIUM / VOLUME_HIGH based on volume and muted.
3.origam-media-volume-control__wrapper
Container inside the tooltip — 14 × 80 px — that hosts the vertical scrubber.
4.origam-media-volume-control__scrubber
<origam-media-scrubber> in vertical orientation. max=1, step=0.05. Collapses to 0 when muted.

API

Props

All props accepted by this component, with their type, default value and description.

volume
required
number
—
Linear volume in [0, 1]. Drives the scrubber position and the volume icon tier.
muted
required
boolean
—
When true, collapses the scrubber to 0 and shows the VOLUME_OFF icon.
muteLabel
required
string
—
aria-label on the toggle button when the media is NOT muted (clicking will mute). Must be pre-translated.
unmuteLabel
required
string
—
aria-label on the toggle button when the media IS muted (clicking will unmute). Must be pre-translated.
volumeLabel
required
string
—
aria-label rendered on the vertical scrubber inside the tooltip. Must be pre-translated.
dataCy
string
'origam-media-volume-control'
data-cy prefix used on the toggle button. The wrapper and scrubber derive their own selectors via convention.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
color
TColor
rounded
boolean | number | string | TRounded | null | undefined
roundedTopRight
boolean | number | string
roundedTopLeft
boolean | number | string
roundedBottomLeft
boolean | number | string
roundedBottomRight
boolean | number | string
roundedStartStart
boolean | number | string
roundedStartEnd
boolean | number | string
roundedEndStart
boolean | number | string
roundedEndEnd
boolean | number | string
size
TSize | number
density
TDensity

API

Emits

Events emitted by this component.

@update:muted
boolean
Fired when the mute toggle is clicked. Payload is the proposed new muted state (!muted).
@update:volume
number
Fired when the vertical scrubber moves. Payload is the new linear volume in [0, 1].

Customisation

CSS variables

CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.

Width and height of the toggle button.
Border radius of the toggle button (full circle by default).
Foreground color of the icon button.
Background color on hover and focus-visible.
Font-size of the volume icon inside the button.
Background color of the tooltip content area containing the scrubber.

Inclusion

Accessibility

ARIA roles, keyboard navigation and focus management. Sourced from the real component template.

ARIA roles

button

Keyboard interactions

Keyboard interactions
KeyAction
Enter / SpaceToggles mute/unmute on the icon button.
Arrow Up / Arrow DownAdjusts volume via the vertical scrubber (step 0.05).
TabMoves focus between the toggle button and the scrubber inside the tooltip.

Notes

  • The toggle button's aria-label switches between muteLabel and unmuteLabel to reflect the current state.
  • The scrubber exposes aria-label (volumeLabel) and aria-valuetext (formatted percentage) for screen readers.
  • The button scale transform on :active is the only animation — it respects prefers-reduced-motion by being a short (120ms) transition.

Interactive

Playground

Edit props live and see the component update in real time. The generated code snippet updates as you change values.

Rendering the live preview…

Usage

Examples

Ready-to-paste code snippets for your templates.

Basic usage

vue

Ecosystem

Family

Components from the same folder that share conventions and often compose together.