ReferenceMenus
PlaybackRateRadioGroup
A menu radio group for selecting playback speed
Creates radio items from the player playback rate state and selects the playback speed.
Import
Anatomy
Behavior
The group is available when the configured media exposes playback rates. It offers the player’s playback rates, or its own when you set rates. Option labels default to the rate followed by a multiplication sign (e.g. 1.5×); pass formatRate to customize them.
When the current rate isn’t one the group offers, such as 1.1 set through the media API, the group adds it as an extra item before the next faster rate. That item carries data-custom, and its accessible name is “Custom, 1.1×” while its visible label stays 1.1×. It goes away once the rate is back on the list.
PlaybackRateRadioGroup.Root uses usePlaybackRateOptions to own selection and renders no element. Wrap the menu’s Menu.Trigger and Menu.Content in it so the trigger inherits the group’s disabled and hidden state and exposes data-availability. PlaybackRateRadioGroup.Options renders the items: its required renderItem callback renders the Menu.RadioItem root and receives item state containing the translated label and current checked value. PlaybackRateRadioGroup.Value displays the selected label, typically inside the trigger. Options and Value render null when the playback rate feature is not configured.
Styling
Unavailable groups receive the native hidden attribute. Each item carries data-rate, and an item for a current rate the group doesn’t offer also carries data-custom.
Accessibility
The group uses the menu radio group pattern.
PlaybackRateRadioGroup.Options receives its accessible label from the label prop on PlaybackRateRadioGroup.Root or defaults to Playback rate. Override it with aria-label or aria-labelledby on PlaybackRateRadioGroup.Options.