npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gfazioli/mantine-video

v1.1.2

Published

A customizable video player component for React built with Mantine. Compound API in Mantine ecosystem style, headless useVideo hook, theme-aware styling, accessibility, and full Styles API.

Readme

Mantine Video Component

NPM version NPM Downloads NPM Downloads NPM License


 ❤️ If this component has been useful to you or your team, please consider becoming a sponsor 

Overview

This component is created on top of the Mantine library. It requires Mantine 9.x and React 19.

Mantine Video is a Mantine‑native video player built on top of the standard HTML <video> element. It pairs a polymorphic root component with a complete compound API (Video.Controls, Video.PlayButton, Video.Timeline, Video.MuteButton, Video.CaptionsButton, Video.PiPButton, Video.FullscreenButton, Video.SkipButton, Video.TimeDisplay) and a fully headless useVideo hook so you can either use the batteries‑included control bar, compose your own with Mantine sub‑components, or build a 100% custom UI on top of the underlying state. Every part is theme‑aware (color scheme, theme colors, radii, sizes), accessible (ARIA labels, keyboard shortcuts, focus management), and customizable through the full Mantine Styles API (classNames, styles, vars, unstyled). Four built‑in variants — overlay, minimal, floating, bordered — cover the most common layouts out of the box. Fullscreen and Picture‑in‑Picture are wired in for browsers that support the standard APIs, with capability‑aware sub‑components that self‑hide when not supported (so you never see a broken button on Firefox).

Features

  • 🎬 Compound APIVideo.Controls, Video.PlayButton, Video.SkipButton, Video.Timeline, Video.TimeDisplay, Video.MuteButton, Video.CaptionsButton, Video.PiPButton, Video.FullscreenButton
  • 🪝 Headless useVideo hook — full state (playing, currentTime, duration, buffered, volume, muted, playbackRate, fullscreen, pip, canPlay, canFullscreen, canPiP, isLoading, error) and actions (play, pause, toggle, seek, seekBy, setVolume, toggleMute, setPlaybackRate, toggleFullscreen, togglePiP)
  • 🎭 Four variantsoverlay (default, YouTube‑style), minimal, floating, bordered
  • 🎨 Mantine theme integrationcolor, radius, size props plus full color‑scheme awareness
  • 🎨 Styles APIclassNames, styles, vars, unstyled on every part
  • ⌨️ Keyboard shortcuts — Space / K (play/pause), J / L (±10s), ←/→ (±5s), ↑/↓ (volume), M (mute), F (fullscreen), P (PiP)
  • 🖥️ Fullscreen + Picture‑in‑Picture out of the box, capability‑aware
  • 🗣️ Captions / subtitles via native <track> — toggle button auto‑hides when no tracks present
  • 🔀 Multiple sources — pass a sources array to ship several formats/codecs and let the browser pick the first it can play (each entry supports type and media), with fallbackSrc loaded if every source fails at runtime
  • 🎛️ Controlled + uncontrolled for playing, currentTime, volume, playbackRate
  • Accessibility — ARIA labels, aria-pressed toggles, focus‑visible outlines
  • 📦 TypeScript — full type safety, every prop documented

[!note]

Demo and DocumentationYoutube VideoMore Mantine Components

Installation

npm install @gfazioli/mantine-video

or

yarn add @gfazioli/mantine-video

After installation import package styles at the root of your application:

import '@gfazioli/mantine-video/styles.css';

Or use the layered version inside @layer mantine-video:

import '@gfazioli/mantine-video/styles.layer.css';

Usage

The simplest usage — pass src, optionally poster and aspectRatio, and you get a fully themed player with play / pause, seekable timeline, time display, volume, captions, picture‑in‑picture and fullscreen out of the box:

import { Video } from '@gfazioli/mantine-video';

function Demo() {
  return (
    <Video
      src="https://example.com/video.mp4"
      poster="https://example.com/poster.jpg"
      aspectRatio={16 / 9}
    />
  );
}

Custom controls

The default control bar is just a sensible composition of compound sub‑components. Pass controls={false} and provide your own <Video.Controls> children to fully customize the layout — reorder, drop, add or theme any part:

import { Video } from '@gfazioli/mantine-video';

function Demo() {
  return (
    <Video src="https://example.com/video.mp4" aspectRatio={16 / 9} controls={false}>
      <Video.Controls>
        <Video.PlayButton />
        <Video.SkipButton seconds={-10} />
        <Video.SkipButton seconds={10} />
        <Video.Timeline />
        <Video.TimeDisplay format="current/-remaining" />
        <Video.MuteButton />
        <Video.CaptionsButton />
        <Video.PiPButton />
        <Video.FullscreenButton />
      </Video.Controls>
    </Video>
  );
}

Headless with useVideo

If you need a completely custom UI, skip <Video> and use the useVideo hook directly. It returns the video state and a full set of actions; just bind the videoRef to a native <video> element:

import { ActionIcon, Slider } from '@mantine/core';
import { IconPlayerPauseFilled, IconPlayerPlayFilled } from '@tabler/icons-react';
import { useVideo } from '@gfazioli/mantine-video';

function Demo() {
  const video = useVideo();

  return (
    <div>
      <video ref={video.videoRef} src="https://example.com/video.mp4" />
      <ActionIcon onClick={video.toggle}>
        {video.playing ? <IconPlayerPauseFilled /> : <IconPlayerPlayFilled />}
      </ActionIcon>
      <Slider value={video.currentTime} max={video.duration} onChange={video.seek} />
    </div>
  );
}

Picture-in-Picture lifecycle

Hook into the user popping the video in and out — for example to dim a sidebar or show a "playing in PiP" indicator elsewhere on the page:

<Video
  src="..."
  onEnterPictureInPicture={() => console.log('entered PiP')}
  onLeavePictureInPicture={() => console.log('left PiP')}
/>

Variants

| Variant | Description | |---------|-------------| | overlay (default) | Controls float over the bottom of the video with a gradient backdrop, fade in on hover, auto‑hide while playing | | minimal | Controls placed below the video in the page flow, no overlay | | floating | Like overlay but the bar is a rounded floating card with a blurred backdrop | | bordered | Bordered container wraps both video and controls below, ideal for cards / lists |

Sponsor

 ❤️ If this component has been useful to you or your team, please consider becoming a sponsor 

Your support helps me:

  • Keep the project actively maintained with timely bug fixes and security updates
  • Add new features, improve performance, and refine the developer experience
  • Expand test coverage and documentation for smoother adoption
  • Ensure long‑term sustainability without relying on ad hoc free time
  • Prioritize community requests and roadmap items that matter most

Open source thrives when those who benefit can give back—even a small monthly contribution makes a real difference. Sponsorships help cover maintenance time, infrastructure, and the countless invisible tasks that keep a project healthy.

Your help truly matters.

💚 Become a sponsor today and help me keep this project reliable, up‑to‑date, and growing for everyone.


Star History Chart