FrameworkStyle

FullscreenButton

A button component for toggling fullscreen mode

Features

  • Automatically switches icons based on fullscreen state
  • Works with browser Fullscreen API
  • Falls back gracefully when fullscreen not supported
  • Accessible keyboard navigation

Example

Data Attributes

The FullscreenButton automatically sets data attributes based on fullscreen state:

  • data-fullscreen - Present when in fullscreen, absent when not

Use these attributes for state-based styling in your CSS.

Props

All standard button props are supported, plus:

Prop Type Description
children ReactNode Button content (typically icons)
className string CSS class name

Accessibility

  • Automatically includes proper ARIA labels
  • Keyboard accessible (Space/Enter)
  • Announces fullscreen state changes to screen readers

Browser Support

The FullscreenButton uses the standard Fullscreen API, which is supported in all modern browsers.

VideoJS