# rehowl

> Opinionated React wrapper for Howler.js

Latest version **1.0.1** (published 2023-11-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install rehowl
pnpm add rehowl
yarn add rehowl
bun add rehowl
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2023-11-08 |
| First published | 2019-11-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 23.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 30 |
| Author | Ted Morin <morinted@gmail.com> |
| Maintainers | morinted |
| Keywords | react, howler, howl, react-component, react.js, audio, player, howler.js |

## Links

- npm: https://www.npmjs.com/package/rehowl
- Repository: https://github.com/morinted/rehowl
- Homepage: https://github.com/morinted/rehowl#readme
- Issues: https://github.com/morinted/rehowl/issues
- npm.io page: https://npm.io/package/rehowl

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2023-11-08
- 1.0.0 — 2023-11-08
- 0.6.0 — 2020-02-10
- 0.5.0 — 2019-11-14
- 0.4.3 — 2019-11-12
- 0.4.2 — 2019-11-12
- 0.4.1 — 2019-11-12
- 0.4.0 — 2019-11-12
- 0.3.1 — 2019-11-12
- 0.3.0 — 2019-11-11
- 0.2.0 — 2019-11-11
- 0.1.0 — 2019-11-11

## README

# Rehowl

An opinionated React wrapper for [howler.js](https://howlerjs.com/)

<!-- TOC -->

- [Rehowl](#rehowl)
  - [Installation](#installation)
  - [Documentation and Live Examples](#documentation-and-live-examples)
  - [Quick start](#quick-start)
  - [Rationale](#rationale)

<!-- /TOC -->

## Installation

Rehowl has react and howler as peer dependencies so that you can manage your own versions.

```sh
npm install howler rehowl
```

```sh
yarn add howler rehowl
```

## Documentation and Live Examples

Documentation and live examples are available at <https://tedmor.in/rehowl>

The source of these examples is [./stories](./stories)

## Quick start

It's recommended to view [the examples](https://tedmor.in/rehowl).

However, at its core Rehowl works by using `useHowl` or `<Howl />` to get a **howl instance**, then playing sounds off that instance with one or more `<Play />` components:

```js
import { useHowl, Play } from 'rehowl'
import bark from './assets/bark.mp3'

const Autoplay = () => {
  const { howl, state } = useHowl({ src: bark })
  return <Play howl={howl} />
}
```

See [the docs](https://tedmor.in/rehowl) for examples on how to play multiple sounds off of one howl, how to use audio sprites, and how to control volume, seek, etc.

## Rationale

When deciding to use Howler in a React project, a quick Google Search brings you to [react-howler](https://khoanguyen.me/react-howler/).

There are a few issues that make ReactHowler unsuitable for my needs:

- No support for playing multiple sounds on one Howl instance
- No support for audio sprites
- If you want to do more than the very basic API, you must break out the howler instance using refs
- Use of componentWillReceiveProps

Overall, it feels much more like a barebones wrapper for Howler that doesn't really give you any help when trying to integrate it into your components.

My main goals in this project are to make a library that feels like Howler, if Howler were built for React.

---
_Source: https://npm.io/package/rehowl · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
