ReferenceMenus
CaptionsRadioGroup
A menu radio group for selecting caption and subtitle tracks
Creates radio items from the player text track state and selects the showing caption or subtitle track.
Import
Anatomy
Behavior
The group is available when the configured media exposes at least one caption or subtitle track. The first generated option is Off; selecting it hides captions. Track labels use the track label, then language, then kind. Pass formatTrack to customize the visible labels.
CaptionsRadioGroup.Root uses useCaptionsOptions 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. CaptionsRadioGroup.Options renders the items, including Off: its required renderItem callback renders the Menu.RadioItem root and receives item state containing the translated label and current checked value. CaptionsRadioGroup.Value displays the selected label, typically inside the trigger. Options and Value render null when the text tracks feature is not configured.
The CaptionsRadioGroup export from the @videojs/react root is a compatibility component that composes Root and Options behind the former single-component props. Prefer the parts for new code.
Styling
Unavailable groups receive the native hidden attribute.
Accessibility
The group uses the menu radio group pattern.
CaptionsRadioGroup.Options receives its accessible label from the label prop on CaptionsRadioGroup.Root or defaults to Captions. Override it with aria-label or aria-labelledby on CaptionsRadioGroup.Options.