Video player settings
ProA video player's settings: a small panel over the picture at the player's corner whose rows open pages in its place (speed, captions, quality), a bottom sheet on phones. Not an M3 component (@windmorph/react-pro).
import { VideoPlayerSettings, VideoPlayerSettingsTrigger, VideoPlayerSettingsItem, VideoPlayerSettingsSwitch, VideoPlayerSettingsChoice, VideoPlayerSettingsSpeed, VideoPlayerSettingsPage } from '@windmorph/react-pro';Part of Windmorph Pro, paid components on the free core, not on sale yet. See the Pro guide for what it includes and to register interest.
Props
VideoPlayerSettings 23 props
Whether it is open (controlled), for use without a trigger or a player.
Whether it starts open (uncontrolled).
The page on show: a row's
id,nullfor the first page (controlled).The page at first (uncontrolled).
The element to open in and stay within (positioned). In a player's slot, the player.
A panel over the picture, or the same pages in a bottom sheet in the theme's colours.
autois a sheet in a window under 600px, decided as it opens.The container's corner it sits at.
In a player's slot, the rows the player can fill (Playback speed, Captions, Loop…) come first;
falsedrops them. A function aschildrenplaces them instead.Replaces the header's
chevron_left.Replaces a row's
chevron_righttoward its page.Replaces a choice's
check.Its rows:
VideoPlayerSettingsItem,Switch,Choice,Speed,Page. As a function, it places the player's rows among its own, in the order it returns them; the player's rows it leaves out don't show (allnulloutside a player):{(rows) => <>{rows.loop}{rows.speed}<Quality />{rows.captions}</>}.Ref to the panel.
The panel's id.
Events
Called when it opens or closes.
Called once it has closed.
Called as the page changes.
Text
Words it says, with English defaults. A
LabelsProvidersets them for the whole app.The panel's name.
The id of what names the panel, in place of
aria-label.
Classes for the panel.
Classes for each part.
The settings' root in either presentation: the panel, or the sheet's content.
The panel over the picture (not the sheet).
The bottom sheet a phone gets.
What scrolls inside a page taller than the room.
Each page.
A page's header: its back row and title.
The header's back mark.
The header's title.
The divider under a header.
A list of rows.
Each row.
A row's icon.
A row's label.
A row's second line.
A row's badge after its label.
A row's value at its end.
The arrow of a row that opens a page.
A choice's tick.
The switch drawn at a switch row's end.
The speed page's body.
The speed in large figures.
The speed's slider.
Slower.
Faster.
The row of presets.
Each preset.
A preset's leading mark.
The caption under a preset.
Inline styles for the panel, e.g.
--wm-video-player-settings-*tokens.
VideoPlayerSettingsTrigger 4 props
The button first (a core
ButtonorIconButton: it getsaria-haspopup,aria-expanded,aria-controlsanddata-open), then theVideoPlayerSettings.Whether it is open (controlled).
Whether it starts open (uncontrolled).
VideoPlayerSettingsItem 14 props
Its name.
Closes the settings after the action, as a menu's action does.
The row's id: its page's id, for
pageandonPageChange.Its icon, in the leading column.
What is chosen, at its end ("Auto (720p)").
A second line, muted.
A mark after the label ("HD"), drawn by the app; text is read after the label ("1080p HD").
What a badge that isn't text is read as, after the label.
The text the first-letter search reads, where the label isn't plain text.
Can't be pressed.
Ref to the row.
VideoPlayerSettingsSwitch 14 props
Its name.
Whether it is on (controlled).
Whether it starts on (uncontrolled).
Ref to the row.
The row's id: its page's id, for
pageandonPageChange.Its icon, in the leading column.
A second line, muted.
A mark after the label ("HD"), drawn by the app; text is read after the label ("1080p HD").
What a badge that isn't text is read as, after the label.
The text the first-letter search reads, where the label isn't plain text.
Can't be pressed.
VideoPlayerSettingsChoice 17 props
The options its page lists.
Its name.
The chosen option (controlled).
The option at first (uncontrolled).
The row's value where it isn't the chosen option's label ("Auto (720p)" for Auto).
A choice closes the settings (at once), or goes back to the first page.
Ref to the row.
The row's id: its page's id, for
pageandonPageChange.Its icon, in the leading column.
A second line, muted.
A mark after the label ("HD"), drawn by the app; text is read after the label ("1080p HD").
What a badge that isn't text is read as, after the label.
The text the first-letter search reads, where the label isn't plain text.
Can't be pressed.
VideoPlayerSettingsSpeed 19 props
The row's id, the page's.
The speed (controlled).
The speed at first (uncontrolled).
The slowest.
The fastest.
The slider's and Slower and Faster's step.
Page Up and Page Down.
A press away; the count is the app's and must fit the row.
The row's label, the page's title and the slider's name.
A speed in words, in place of the labels' "Normal" and "1.5×": the row's value, the slider's words and what Slower and Faster say.
The row's icon.
Replaces Slower's
remove.Replaces Faster's
add.Ref to the row.
Events
Called as the speed changes.
Called when a preset is pressed, a disabled one included.
Text
Words it says. A
LabelsProvidersets them for the whole app.The row's label, the page's title and the slider's name.
The speed of 1: the row's value, and the caption under its preset.
The button one step slower.
The button one step faster.
The presets' group.
A speed in words: the row's value, the slider's and what Slower and Faster say.
The large value, two decimals.
A preset's figure, given at least one decimal ("1.0", "1.25").
VideoPlayerSettingsPage 13 props
The page's own content, under the same header.
Its name.
The row's id: its page's id, for
pageandonPageChange.Its icon, in the leading column.
What is chosen, at its end ("Auto (720p)").
A second line, muted.
A mark after the label ("HD"), drawn by the app; text is read after the label ("1080p HD").
What a badge that isn't text is read as, after the label.
The text the first-letter search reads, where the label isn't plain text.
Can't be pressed.
Ref to the row.
Types
VideoPlayerSettingsOption 6 fields
One option of a VideoPlayerSettingsChoice.
badgetypestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<AwaitedReactNode>A mark after the label ("HD"); text is read after the label ("1080p HD").
What a badge that isn't text is read as.
VideoPlayerSettingsSpeedPreset 4 fields
A preset: a speed a press away, with an optional caption under it and a leading mark.
Under the preset ("Normal" under 1 by default).
leadingtypestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<AwaitedReactNode>Before the figure: an app's mark (a locked speed's badge); name it if it means something.
Doesn't change the speed:
onPresetPresstells the app (a locked speed).
Spec status
Not part of Material Design 3: a Windmorph Pro component, built on M3's colour roles, type scale, shapes and motion. Its variants and configurations each link to a live example.
| Item | Status | Details |
|---|---|---|
In a player's settings slot, with the rows the player fills | Built | Use case · Slot |
The player's rows placed among yours (children as a function) | Built | Configuration · Slot |
Badges on a row and its options (badge, badgeLabel) | Built | Configuration · Slot |
A choice page (VideoPlayerSettingsChoice) | Built | Configuration · Slot, Alone |
Alone, from your own button (VideoPlayerSettingsTrigger, container) | Built | Use case · Alone |
The speed page, with a locked preset (VideoPlayerSettingsSpeed) | Built | Configuration · Alone |
| A switch, an action and a page of your own | Built | Configuration · Alone |
| Not an M3 component | Extension | M3’s menus open submenus beside the item and are modal; this panel’s pages take its place at the player’s corner and leave the video playing, with the core BottomSheet on phones. |
| Readable over any picture | Extension | Its fill (72% scrim) keeps every word at 4.5:1 over a white frame without the blur, a selected preset’s label included, in every theme and contrast level. |
In a player's
Builtsettingsslot, with the rows the player fillsUse case · Slot
The player's rows placed among yours (
Builtchildrenas a function)Configuration · Slot
Badges on a row and its options (
Builtbadge,badgeLabel)Configuration · Slot
Alone, from your own button (
BuiltVideoPlayerSettingsTrigger,container)Use case · Alone
The speed page, with a locked preset (
BuiltVideoPlayerSettingsSpeed)Configuration · Alone
A switch, an action and a page of your own
BuiltConfiguration · Alone
Not an M3 component
ExtensionM3’s menus open submenus beside the item and are modal; this panel’s pages take its place at the player’s corner and leave the video playing, with the core
BottomSheeton phones.Readable over any picture
ExtensionIts fill (72%
scrim) keeps every word at 4.5:1 over a white frame without the blur, a selected preset’s label included, in every theme and contrast level.
Theming & tokens
Set the tokens below on the settings or any ancestor. Its colours, fill, blur, state layers and focus ring default to the shared --wm-on-media-* tokens (on the Video player page), so one override reaches the player and its settings. The fill is 72% scrim and the quieter text 88%, the least that keep every word at 4.5:1 over a white frame, a selected preset's label included; the blur is extra, and under reduced transparency the fill is opaque. The speed's slider takes the --wm-media-slider-* tokens, and the sheet the core sheet's. The panel carries data-open while open. className goes on the panel; style each part with classNames: root, panel, sheet, scroller, page, header, back, title, divider, list, row, rowIcon, rowLabel, rowDescription, rowBadge, rowValue, rowArrow, check, switch, speed, speedValue, slider, slower, faster, presets, preset, presetLeading, presetCaption.
| Variable | Default | Paints |
|---|---|---|
--wm-video-player-settings-container-color | color-mix(in srgb, var(--md-sys-color-scrim) 72%, transparent) | The panel’s see-through ground: the least that keeps every word, a preset’s label on its fill included, at 4.5:1 over a white picture (`settings-contrast.test.ts`); the blur and its opaque fallback are the on-media ones. |
--wm-video-player-settings-width | 320px | The panel’s width, the same on every page (never wider than its container allows). |
--wm-video-player-settings-corner | var(--md-sys-shape-corner-medium) | The panel’s corners. |
--wm-video-player-settings-padding-bottom | 12px | The space under a list’s last row. |
--wm-video-player-settings-inset-end | 12px | The panel’s distance from its container’s end edge (a player sets its own). |
--wm-video-player-settings-inset-bottom | 12px | The panel’s distance from its container’s foot (a player puts it over its controls). |
--wm-video-player-settings-inset-top | 12px | The least room above the panel: a taller page scrolls inside. |
--wm-video-player-settings-header-height | 56px | A page’s header, its back row and title, above its divider: its state layer and the space above and below it. |
--wm-video-player-settings-header-layer-inset | 4px | How far a page header’s state layer sits in from the header’s top and foot, as a row’s does, so its corners never meet the panel’s. |
--wm-video-player-settings-back-inset | 16px | The back mark’s 24px box, from the panel’s start edge: over the rows’ icons. |
--wm-video-player-settings-title-inset | 64px | Where a page’s title starts, from the panel’s start edge: over the rows’ labels. |
--wm-video-player-settings-divider-color | color-mix(in srgb, var(--md-sys-color-on-surface) 20%, transparent) | The full-width hairline under a page’s header. |
--wm-video-player-settings-row-height | 48px | A row’s least height (it grows for a second line or larger text). |
--wm-video-player-settings-text-inset | 64px | Where a row’s text starts, from the panel’s start edge, leaving the icon’s column: the icon 8px inside the row’s state layer. |
--wm-video-player-settings-row-layer-inset | 8px | How far a row’s state layer sits in from the panel’s sides. |
--wm-video-player-settings-row-layer-corner | var(--md-sys-shape-corner-small) | A row’s state layer’s corners. |
--wm-video-player-settings-muted-color | color-mix(in srgb, var(--md-sys-color-on-surface) 88%, transparent) | A second line, a row’s value and a preset’s caption: only as dim as 4.5:1 over a white picture allows. |
--wm-video-player-settings-speed-padding-top | 24px | The speed page’s space above its value. |
--wm-video-player-settings-speed-padding-inline | 16px | The speed page’s sides. |
--wm-video-player-settings-speed-padding-bottom | 16px | The speed page’s space under its presets. |
--wm-video-player-settings-speed-gap | 24px | The space between the value, the slider’s row and the presets. |
--wm-video-player-settings-button-gap | 16px | The space between Slower and Faster and the slider. |
--wm-video-player-settings-preset-height | 32px | A preset’s height. |
--wm-video-player-settings-preset-gap | 8px | The space between presets. |
--wm-video-player-settings-preset-color | color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent) | A preset’s see-through fill; Slower and Faster take it too. |
--wm-video-player-settings-preset-selected-color | color-mix(in srgb, var(--md-sys-color-on-surface) 18%, transparent) | The preset at the current speed: a deeper fill (no deeper than keeps its label at 4.5:1 over a white picture), with an emphasized label. |
--wm-video-player-settings-caption-gap | 4px | The space between a preset and its caption. |
--wm-video-player-settings-fade-duration | var(--md-sys-motion-duration-short-1) | The panel’s fade as it opens and closes (a choice closes it with none). |
--wm-video-player-settings-page-duration | var(--md-sys-motion-duration-short-3) | How long a page takes to slide in and the height to follow (at once under reduced motion). |
--wm-video-player-settings-easing | var(--md-sys-motion-easing-standard) | The easing of the fade, the slide and the height. |
--wm-video-player-settings-back-size | 24px | The back mark in a page’s header. |
--wm-video-player-settings-divider-thickness | 1px | The hairline under a page’s header. |
--wm-video-player-settings-row-gap | 24px | The space between a row’s icon and its text. |
--wm-video-player-settings-icon-size | 24px | A row’s icon, and the column it sits in. |
--wm-video-player-settings-preset-corner | var(--md-sys-shape-corner-full) | A speed preset’s corners. |