Controls is a compound component that manages the visibility of player controls. It shows controls when the user is active or when the video is paused, and hides them after a short delay when the user becomes inactive.
Sub-components
| Component | Description |
|---|---|
Controls.Root | Root container that tracks user activity and manages control visibility. |
Controls.Group | Layout group for related controls. Receives role="group" when labeled. |
Controls.Root requires the controls feature to be registered with the player.Import
Basic Usage
Controls.Root Props
Child controls or
Controls.Group elements to render inside the root container.Custom render prop for the root
<div> element.CSS class name or a function that receives state and returns a class name.
Inline style or a function that receives state and returns a style object.
Controls.Group Props
Child controls to group together.
When provided, the group receives
role="group" and this label is announced by screen readers.Alternative to
aria-label. When provided, the group receives role="group".Custom render prop for the group
<div> element.CSS class name or a function that receives state and returns a class name.
Inline style or a function that receives state and returns a style object.
State Data Attributes
These attributes are reflected on theControls.Root element.
| Attribute | Description |
|---|---|
data-visible | Present when controls should be visible (user active or video paused). |
CSS Styling Example
Behavior
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.
Accessibility
No ARIA role is applied toControls.Root — it is a layout wrapper, not a landmark. Controls.Group automatically receives role="group" only when an aria-label or aria-labelledby attribute is provided.