MediaVolumeControl

Media
stable

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

Structure

Anatomie

Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.

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

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.

volume
requis
number
—
Linear volume in [0, 1]. Drives the scrubber position and the volume icon tier.
muted
requis
boolean
—
When true, collapses the scrubber to 0 and shows the VOLUME_OFF icon.
muteLabel
requis
string
—
aria-label on the toggle button when the media is NOT muted (clicking will mute). Must be pre-translated.
unmuteLabel
requis
string
—
aria-label on the toggle button when the media IS muted (clicking will unmute). Must be pre-translated.
volumeLabel
requis
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

Événements émis par ce composant.

@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].

Personnalisation

Variables CSS

Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.

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

Accessibilité

Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.

Rôles ARIA

button

Interactions clavier

Interactions clavier
ToucheAction
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.

Interactif

Playground

Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.

Rendu de l’aperçu en cours…

Usage

Exemples

Extraits de code prêts à coller dans vos templates.

Basic usage

vue

Écosystème

Famille

Composants du même dossier qui partagent les conventions et se composent souvent ensemble.