ReferenceLayout
Controls
Container component for composing and auto-hiding video player controls on user interaction
Import
Anatomy
Import the component and assemble its parts:
Behavior
If the user is active, or if the video is paused, this component will show controls. Otherwise, it will hide them after a short delay.
User activity is tracked via pointer movement, keyboard input, and focus events on the player container. On touch devices, a quick tap toggles visibility. mouseleave immediately sets the user as inactive.
visibility selects between the two modes. The default, auto, follows the player’s controls visibility state as described above. always keeps the controls visible and reports the user as active regardless of playback or idle state, and works without the controls feature. The idle delay itself is not configurable.
Styling
Controls.Root is a state and context provider. Controls.Content renders the interactive controls surface and receives its DOM props, ref, and controls state data attributes.
Controls.Backdrop is an optional presentational sibling of Controls.Content. It receives the same controls state data attributes, allowing its styling and transitions to be authored independently from the controls surface.
By default, controls have the following styles:
React renders <div> elements. Add a className to style them:
Accessibility
Controls.Root renders no element. No ARIA role is applied to Controls.Content because it is a layout surface, not a landmark. Controls.Backdrop is always hidden from assistive technology. Controls.Group automatically receives role="group" when an aria-label or aria-labelledby attribute is provided; otherwise no role is assigned.
Examples
Basic Usage
API Reference
Root
Manages controls state and provides it to the compound parts. Does not render an element.
Props
State
render, className, and style props.