Skip to main content

Menu

The Menu component provides a settings/navigation system for the video player.
It uses the BottomSheet as the container and supports:

  • Nested sub-menus with smooth slide animations.
  • Checkboxes and interactive items.
  • Fully customizable headers and content areas.
  • Automatic integration with the player's theme.

Usage

import { Menu } from 'react-native-video-toolkit';

export function Example() {
return (
<Menu.Root>
<Menu.Trigger />

<Menu.Content>
<Menu.SubContent viewId="root">
<Menu.Label>Playback</Menu.Label>
<Menu.Item navigateTo="quality">Quality</Menu.Item>
</Menu.SubContent>

<Menu.SubContent viewId="quality">
<Menu.CheckboxItem checked={true} onCheckedChange={console.log}>
1080p
</Menu.CheckboxItem>
<Menu.CheckboxItem checked={false} onCheckedChange={console.log}>
720p
</Menu.CheckboxItem>
</Menu.SubContent>
</Menu.Content>
</Menu.Root>
);
}

API Reference

Wraps all menu components and manages the navigation stack.

PropTypeDefaultRequiredDescription
initialViewstring"root"NoThe first viewId in the stack.

Button that opens the menu.

PropTypeRequiredDescription
...propsSettingsButtonPropsNoProps passed to the SettingsButton.

Header for the menu, with back/close buttons and a title.

PropTypeDefaultRequiredDescription
titlestringNoTitle of the current view.
showBackButtonbooleantrueNoShow the back button.
showCloseButtonbooleantrueNoShow the close button.
...propsViewPropsNoAdditional props for the header container.

The BottomSheet wrapper for menu views.

PropTypeDefaultRequiredDescription
childrenReactNodeYesNested Menu.SubContent blocks.
header(currentView: string) => ReactNodeNoOptional custom header renderer.
sheetStyleViewStyleNoCustom style for the sheet body.

Renders content for a specific viewId. Only visible when currentView matches.

PropTypeRequiredDescription
viewIdstringYesID to match against navigation stack.
childrenReactNodeYesSub-menu items.

Basic clickable row. Can either close the menu or navigate to a sub-view.

PropTypeDefaultRequiredDescription
onPress(value?: any) => voidNoAction when pressed.
navigateTostringNoIf set, navigates to this sub-view.
autoClosebooleantrueNoIf true, closes menu after press (ignored if navigateTo is provided).
disabledbooleanfalseNoDisables interaction.
valueanyNoOptional value passed to onPress.

Non-interactive label for section headers.

PropTypeRequiredDescription
childrenReactNodeYesThe label text.

Divider line between items.

PropTypeRequiredDescription
styleViewStyleNoCustom style for the line.

Simple wrapper for grouping related items.

PropTypeRequiredDescription
childrenReactNodeYesThe items to group.

Toggleable option with a check indicator.

PropTypeDefaultRequiredDescription
checkedbooleanNoControlled checked state.
onCheckedChange(checked: boolean) => voidNoCalled when toggled.

If checked is not provided, it manages its own state.


Button that closes the menu manually.

PropTypeRequiredDescription
...propsPressablePropsNoProps passed to the Pressable.

Button that navigates back in the menu stack.

PropTypeRequiredDescription
...propsPressablePropsNoProps passed to the Pressable.

Styling

  • Colors, background, and borders adapt automatically to theme from useVideo().
  • Animations are handled by react-native-reanimated.
  • You can pass style and textStyle props to most components for customization.