Skip to content
FrameworkStyle

AudioTrackRadioGroup

A menu radio group for selecting an audio track

Creates radio items from the player audio track state and selects the enabled track.

Anatomy

const audioTrack = useAudioTrackOptions();

<Menu.RadioGroup value={audioTrack.value} onValueChange={audioTrack.setValue}>
  <Menu.GroupLabel>Audio</Menu.GroupLabel>
  {audioTrack.options.map((option) => (
    <Menu.RadioItem key={option.value} value={option.value} disabled={option.disabled}>
      {option.label}
      <Menu.ItemIndicator checked={option.value === audioTrack.value} />
    </Menu.RadioItem>
  ))}
</Menu.RadioGroup>

Behavior

The group is available when the configured media exposes more than one audio track. Labels use the track label, then language, then kind. Pass formatTrack to customize the visible labels.

useAudioTrackOptions returns null when the audio track feature is not configured. Use the returned options with Menu.RadioGroup.

Styling

Attribute Values Description
data-audio-track string Current audio track value.
data-disabled Present / absent Present when audio track selection is disabled.
data-availability "available" / "unavailable" Whether multiple audio tracks are available.

Accessibility

The group uses the menu radio group pattern. It receives an accessible label from the label prop or defaults to Audio.