These are the styled parts. Each is built on one with the same name in react-video-kit/primitives, which has no skin. To see how they fit together, read Styled parts.
Plugin parts, such as Fullscreen and CaptionsMenu, are listed on each plugin's page.
All of this page comes from the package's types, so it's always up to date.
Components
AsChild
Renders the single child with a part's behaviour, instead of the part's element.
BufferingIndicator
Button
A control button. data-control is what the skin styles.
Prop
Type
Description
asChild?
boolean
Merges behaviour onto the single child instead of rendering a button.
ControlGroup
A pill of related controls.
ControlRow
Controls
Holds the controls. Stays mounted while hidden, so Tab can reveal it.
CurrentTime
Current position. Writes to the DOM directly, so playback causes no renders.
Duration
ErrorOverlay
Explains a fatal error in the viewer's language, with a code to quote to support, in place of an endless spinner. It offers a retry unless the error rules that out.
Prop
Type
Description
title?
string
Replaces the title, whatever the error.
messages?
Partial<Record<VideoErrorCode, ErrorMessage>>
Replaces the text for particular error codes.
Media
The media element. The active provider owns its source, so this renders no src or <source> children. Pass <track> elements as children.
Menu
A menu that renders inside the player, so it keeps working in fullscreen. Submenus drill down in place rather than opening beside it.
Prop
Type
Description
children?
ReactNode
The menu's trigger and content.
onOpenChange?
((open: boolean) => void)
Called as the menu opens and closes.
MenuContent
Prop
Type
Description
children?
ReactNode
The rows at the top level of the menu.
MenuItem
Prop
Type
Description
disabled?
boolean
Stops the item being chosen or reached with the keyboard.
onSelect?
(() => void)
Runs when chosen. The menu closes afterwards unless keepOpen is set.
keepOpen?
boolean
Leaves the menu open after the item is chosen.
MenuRadioGroup
Prop
Type
Description
value
string | null
The value of the checked item, or null when none is checked.
onValueChange
(value: string) => void
Called with an item's value when the viewer chooses it.
MenuRadioItem
Prop
Type
Description
value
string
Identifies this item to the group, and is what onValueChange receives.
MenuSub
A row that drills down to a panel of its own.
Prop
Type
Description
title
ReactNode
The row's name, which also titles the submenu.
value?
ReactNode
The current value, shown at the end of the row. A value that changes during playback should be a component that reads it, so that nothing renders until the menu is open.
icon?
ReactNode
Shown before the title.
backLabel?
string
Labels the back button.
MenuTrigger
Prop
Type
Description
asChild?
boolean
Merges behaviour onto the single child instead of rendering a button.
Mute
Prop
Type
Description
asChild?
boolean
Merges behaviour onto the single child instead of rendering a button.
PlayOverlay
Prop
Type
Description
asChild?
boolean
Merges behaviour onto the single child instead of rendering a button.
PlayPause
Icons stack in one grid cell, so the skin can cross-fade between states.
Prop
Type
Description
asChild?
boolean
Merges behaviour onto the single child instead of rendering a button.
PlayerContext
RemainingTime
Time left, written to the DOM directly like CurrentTime.
Root
The player root with the default skin. Import react-video-kit/styles.css for it.
Prop
Type
Description
src?
SourceInput | null
The video to play, which loads afresh when its value changes.
plugins?
readonly AnyPlugin[]
Set once. Define the array outside the component or memoize it.
load?
LoadStrategy
When the provider and its engine load. Set once. Defaults to eager.
player?
Player
Bring your own player instead of creating one.
onError?
((error: MediaErrorInfo) => void)
Called with every error, fatal or not, for logging. It can change between renders.
children?
ReactNode
Content rendered inside the player's root element.
SeekButton
Prop
Type
Description
seconds
number
Seconds to move. Negative goes back.
asChild?
boolean
Merges behaviour onto the single child instead of rendering a button.
SettingsMenu
A menu of whatever plugins contribute to the menu slot. Hidden when empty.
Prop
Type
Description
children?
ReactNode
The rows at the top level of the menu.
Slot
Renders what plugins contributed to name, in plugin order.
Prop
Type
Description
name
SlotName
The slot to render, such as overlay or menu.
Time
Current time and duration together.
Timeline
The seek bar. A real range input provides focus, keyboard, and screen reader support, while the visible track takes pointer input over a larger hit area.
Prop
Type
Description
step?
number
Seconds moved by the arrow keys.
largeStep?
number
Seconds moved by Page Up and Page Down.
children?
ReactNode
Replaces the default track, thumb, and preview.
TimelineBuffered
TimelineFill
TimelinePreview
Follows the pointer with the time under it, staying inside the track.
Prop
Type
Description
children?
ReactNode
Shown above the time, such as a thumbnail.
TimelineThumb
The rail spans the track and moves as a whole, so percentages need no measuring.
TimelineTrack
Title
The video's name, with an optional line above it and a description below.
Prop
Type
Description
title?
ReactNode
The video's name.
eyebrow?
ReactNode
A short line above the title, such as a series or an episode.
description?
ReactNode
A sentence or two about the video, which shows while it's paused.
Transport
The buttons in the centre of the picture: seek back, play, and seek forward.
Prop
Type
Description
seekSeconds?
number
How far the buttons on either side of play jump, in seconds.
Volume
Mute button and slider, with the slider opening as the pointer arrives.
VolumeSlider
Renders nothing where the platform owns volume, such as iOS.
Prop
Type
Description
step?
number
Change per arrow key press, from 0 to 1.
Icons
AirPlayIcon
CaptionsIcon
CastIcon
FullscreenEnterIcon
FullscreenExitIcon
NextIcon
PauseIcon
PipEnterIcon
PipExitIcon
PlayIcon
PreviousIcon
ReplayIcon
SeekIcon
A ring with an arrowhead, turning back or forward, and the seconds in the middle.
Prop
Type
Description
seconds
number
The seconds shown in the ring, with a negative number turning the arrow back.
SettingsIcon
SpinnerIcon
Eight ticks, fading around the circle. The skin turns it one tick at a time.
VolumeIcon
The speaker. The skin reads --rv-volume from the mute button, so each wave fades with the level, and the slash falls across the speaker when it's muted.
Hooks
useClock
Runs write as playback advances, without rendering. Use this for anything that follows time: fills, thumbs, and text written straight to the DOM.
Compares one level deep, for selectors that build arrays or objects.
<Value>(a: Value, b: Value) => boolean
Types
BufferingIndicatorProps
BufferingIndicatorProps
ButtonProps
Field
Type
Description
asChild?
boolean
Merges behaviour onto the single child instead of rendering a button.
ControlGroupProps
ControlGroupProps
ControlRowProps
ControlRowProps
ControlsProps
ControlsProps
CurrentTimeProps
TimeProps
DurationProps
TimeProps
ErrorMessage
Field
Type
Description
title?
string
Replaces the title.
detail?
string
Replaces the line under the title.
ErrorOverlayProps
Field
Type
Description
title?
string
Replaces the title, whatever the error.
messages?
Partial<Record<VideoErrorCode, ErrorMessage>>
Replaces the text for particular error codes.
IconProps
IconProps
MediaProps
MediaProps
MenuContentProps
Field
Type
Description
children?
ReactNode
The rows at the top level of the menu.
MenuItemProps
Field
Type
Description
disabled?
boolean
Stops the item being chosen or reached with the keyboard.
onSelect?
(() => void)
Runs when chosen. The menu closes afterwards unless keepOpen is set.
keepOpen?
boolean
Leaves the menu open after the item is chosen.
MenuProps
Field
Type
Description
children?
ReactNode
The menu's trigger and content.
onOpenChange?
((open: boolean) => void)
Called as the menu opens and closes.
MenuRadioGroupProps
Field
Type
Description
value
string | null
The value of the checked item, or null when none is checked.
onValueChange
(value: string) => void
Called with an item's value when the viewer chooses it.
MenuRadioItemProps
Field
Type
Description
value
string
Identifies this item to the group, and is what onValueChange receives.
MenuSubProps
Field
Type
Description
title
ReactNode
The row's name, which also titles the submenu.
value?
ReactNode
The current value, shown at the end of the row. A value that changes during playback should be a component that reads it, so that nothing renders until the menu is open.
icon?
ReactNode
Shown before the title.
backLabel?
string
Labels the back button.
MenuTriggerProps
Field
Type
Description
asChild?
boolean
Merges behaviour onto the single child instead of rendering a button.
MuteProps
Field
Type
Description
asChild?
boolean
Merges behaviour onto the single child instead of rendering a button.
PlayOverlayProps
Field
Type
Description
asChild?
boolean
Merges behaviour onto the single child instead of rendering a button.
PlayPauseProps
Field
Type
Description
asChild?
boolean
Merges behaviour onto the single child instead of rendering a button.
RemainingTimeProps
TimeProps
RootProps
Field
Type
Description
src?
SourceInput | null
The video to play, which loads afresh when its value changes.
plugins?
readonly AnyPlugin[]
Set once. Define the array outside the component or memoize it.
load?
LoadStrategy
When the provider and its engine load. Set once. Defaults to eager.
player?
Player
Bring your own player instead of creating one.
onError?
((error: MediaErrorInfo) => void)
Called with every error, fatal or not, for logging. It can change between renders.
children?
ReactNode
Content rendered inside the player's root element.
SeekButtonProps
Field
Type
Description
seconds
number
Seconds to move. Negative goes back.
asChild?
boolean
Merges behaviour onto the single child instead of rendering a button.
SettingsMenuProps
Field
Type
Description
children?
ReactNode
The rows at the top level of the menu.
TimeProps
TimeProps
TimelinePartProps
TimelinePartProps
TimelinePreviewProps
Field
Type
Description
children?
ReactNode
Shown above the time, such as a thumbnail.
TimelineProps
Field
Type
Description
step?
number
Seconds moved by the arrow keys.
largeStep?
number
Seconds moved by Page Up and Page Down.
children?
ReactNode
Replaces the default track, thumb, and preview.
TitleProps
Field
Type
Description
title?
ReactNode
The video's name.
eyebrow?
ReactNode
A short line above the title, such as a series or an episode.
description?
ReactNode
A sentence or two about the video, which shows while it's paused.
TransportProps
Field
Type
Description
seekSeconds?
number
How far the buttons on either side of play jump, in seconds.