{"id":50190613,"url":"https://gfazioli.github.io/mantine-audio/","last_synced_at":"2026-06-11T04:01:05.993Z","repository":{"id":359070881,"uuid":"1243755335","full_name":"gfazioli/mantine-audio","owner":"gfazioli","description":"A Mantine-native audio player for React with waveform visualization and live spectrum analyzer, built on Web Audio API. Compound component API + headless useAudio hook.","archived":false,"fork":false,"pushed_at":"2026-06-03T08:37:11.000Z","size":19558,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-03T10:21:01.823Z","etag":null,"topics":["audio","audio-player","component","compound-component","headless","mantine","mantine-extension","mantine-ui","mantine-v9","podcast","react","react-audio","react-component","spectrum-analyzer","typescript","waveform","web-audio-api"],"latest_commit_sha":null,"homepage":"https://gfazioli.github.io/mantine-audio/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gfazioli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["gfazioli"]}},"created_at":"2026-05-19T16:25:18.000Z","updated_at":"2026-06-03T08:36:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gfazioli/mantine-audio","commit_stats":null,"previous_names":["gfazioli/mantine-audio"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gfazioli/mantine-audio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfazioli%2Fmantine-audio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfazioli%2Fmantine-audio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfazioli%2Fmantine-audio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfazioli%2Fmantine-audio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gfazioli","download_url":"https://codeload.github.com/gfazioli/mantine-audio/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfazioli%2Fmantine-audio/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34181555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio","audio-player","component","compound-component","headless","mantine","mantine-extension","mantine-ui","mantine-v9","podcast","react","react-audio","react-component","spectrum-analyzer","typescript","waveform","web-audio-api"],"created_at":"2026-05-25T13:00:45.658Z","updated_at":"2026-06-11T04:01:05.944Z","avatar_url":"https://github.com/gfazioli.png","language":"TypeScript","funding_links":["https://github.com/sponsors/gfazioli","https://github.com/sponsors/gfazioli?o=esc"],"categories":["Libraries"],"sub_categories":[],"readme":"# Mantine Audio Component\n\n\u003cimg alt=\"Mantine Audio\" src=\"https://github.com/gfazioli/mantine-audio/blob/master/logo.jpeg\" /\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n  [![NPM version](https://img.shields.io/npm/v/%40gfazioli%2Fmantine-audio?style=for-the-badge)](https://www.npmjs.com/package/@gfazioli/mantine-audio)\n  [![NPM Downloads](https://img.shields.io/npm/dm/%40gfazioli%2Fmantine-audio?style=for-the-badge)](https://www.npmjs.com/package/@gfazioli/mantine-audio)\n  [![NPM Downloads](https://img.shields.io/npm/dy/%40gfazioli%2Fmantine-audio?style=for-the-badge\u0026label=%20\u0026color=f90)](https://www.npmjs.com/package/@gfazioli/mantine-audio)\n  ![NPM License](https://img.shields.io/npm/l/%40gfazioli%2Fmantine-audio?style=for-the-badge)\n\n---\n\n[\u003ckbd\u003e \u003cbr/\u003e ❤️ If this component has been useful to you or your team, please consider becoming a sponsor \u003cbr/\u003e \u003c/kbd\u003e](https://github.com/sponsors/gfazioli?o=esc)  \n\n\u003c/div\u003e\n\n## Overview\n\nThis component is built on top of the [Mantine](https://mantine.dev/) library.\n\nThe [Mantine Audio](https://gfazioli.github.io/mantine-audio/) component is a Mantine-native audio player for React with **waveform visualisation** and a **live spectrum analyser**, built on the Web Audio API. It ships as three layers in a single package: a polished default `\u003cAudio /\u003e` with four variants, a fully composable compound API (ten sub-components you can reorder and restyle), and a fully headless `useAudio` hook to build 100% custom UIs.\n\n## Features\n\n- 🎧 **Drop-in player** — `\u003cAudio src=\"…\" /\u003e` and you have a styled, accessible audio player\n- 🧩 **Compound API** — 10 sub-components (`Audio.PlayButton`, `Audio.Timeline`, `Audio.Waveform`, `Audio.Spectrum`, `Audio.VolumeSlider`, `Audio.SpeedControl`, …) reorderable and re-styleable\n- 🪝 **Headless `useAudio` hook** — 16 state values + 12 actions for fully custom UIs\n- 🌊 **Waveform visualisation** — peaks decoded via Web Audio + click/drag to seek, 60fps playhead tracking via RAF\n- 🎚️ **Live spectrum analyser** — `AnalyserNode` driven, solid or gradient bars, optional mirror\n- 🔀 **Multiple `\u003csource\u003e` support** — `sources={[…]}` for codec / format / media-query fallbacks + `fallbackSrc` for runtime errors\n- 🎛️ **5 sizes × 4 variants** — `xs/sm/md/lg/xl` × `overlay/minimal/floating/bordered` (all CSS-driven via data attributes)\n- 🌅 **`asBackground` preset** — turn the same player into a hero / section ambient track in one line\n- 🎚️ **Scrub-with-sound** — optional `scrubSound` lets the user hear snippets while dragging (Audacity / iTunes style)\n- ⌨️ **Keyboard shortcuts** — Space, J/K/L, ←/→, ↑/↓, M, \u003e / \u003c\n- 🎨 **Full Styles API** — `classNames`, `styles`, `vars`, `unstyled`, theme-aware out of the box\n- 📦 **TypeScript** — strict types, every prop documented\n\n\u003e [!note]\n\u003e\n\u003e → [Demo and Documentation](https://gfazioli.github.io/mantine-audio/) → [More Mantine Components](https://mantine-extensions.vercel.app/)\n\n## Installation\n\n```sh\nnpm install @gfazioli/mantine-audio\n```\n\nor\n\n```sh\nyarn add @gfazioli/mantine-audio\n```\n\nAfter installation import package styles at the root of your application:\n\n```tsx\nimport '@gfazioli/mantine-audio/styles.css';\n```\n\n## Usage\n\n```tsx\nimport { Audio } from '@gfazioli/mantine-audio';\n\nfunction Demo() {\n  return \u003cAudio src=\"/track.mp3\" /\u003e;\n}\n```\n\nCompound layout with waveform on top and a custom skip button:\n\n```tsx\n\u003cAudio src=\"/track.mp3\"\u003e\n  \u003cAudio.Waveform height={80} /\u003e\n  \u003cAudio.Controls\u003e\n    \u003cAudio.SkipButton seconds={-15} /\u003e\n    \u003cAudio.PlayButton /\u003e\n    \u003cAudio.SkipButton seconds={15} /\u003e\n    \u003cAudio.Timeline /\u003e\n    \u003cAudio.TimeDisplay /\u003e\n    \u003cAudio.MuteButton /\u003e\n    \u003cAudio.VolumeSlider /\u003e\n    \u003cAudio.SpeedControl /\u003e\n  \u003c/Audio.Controls\u003e\n\u003c/Audio\u003e\n```\n\nHeadless usage with the `useAudio` hook:\n\n```tsx\nimport { useAudio } from '@gfazioli/mantine-audio';\n\nfunction MyPlayer() {\n  const { playing, currentTime, duration, peaks, analyser, toggle, audioRef } = useAudio({\n    src: '/track.mp3',\n  });\n\n  return (\n    \u003cdiv\u003e\n      \u003caudio ref={audioRef} crossOrigin=\"anonymous\" /\u003e\n      \u003cbutton onClick={toggle}\u003e{playing ? 'Pause' : 'Play'}\u003c/button\u003e\n      \u003cspan\u003e{currentTime.toFixed(1)} / {duration.toFixed(1)}\u003c/span\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n## Sponsor\n\n\u003cdiv align=\"center\"\u003e\n\n[\u003ckbd\u003e \u003cbr/\u003e ❤️ If this component has been useful to you or your team, please consider becoming a sponsor \u003cbr/\u003e \u003c/kbd\u003e](https://github.com/sponsors/gfazioli?o=esc)\n\n\u003c/div\u003e\n\nYour support helps me:\n\n- Keep the project actively maintained with timely bug fixes and security updates\t\n- Add new features, improve performance, and refine the developer experience\t\n- Expand test coverage and documentation for smoother adoption\t\n- Ensure long‑term sustainability without relying on ad hoc free time\t\n- Prioritize community requests and roadmap items that matter most\n\nOpen 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.\n\nYour help truly matters.\n\n💚 [Become a sponsor](https://github.com/sponsors/gfazioli?o=esc) today and help me keep this project reliable, up‑to‑date, and growing for everyone.\n\n---\n  \n[![Star History Chart](https://api.star-history.com/svg?repos=gfazioli/mantine-audio\u0026type=Timeline)](https://www.star-history.com/#gfazioli/mantine-audio\u0026Timeline)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/gfazioli.github.io%2Fmantine-audio%2F","html_url":"https://awesome.ecosyste.ms/projects/gfazioli.github.io%2Fmantine-audio%2F","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/gfazioli.github.io%2Fmantine-audio%2F/lists"}