# react-guitar-sound

> A React Hook to play sound with react-guitar.

Latest version **1.1.5** (published 2026-01-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-guitar-sound
pnpm add react-guitar-sound
yarn add react-guitar-sound
bun add react-guitar-sound
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.1.5 |
| Published | 2026-01-06 |
| First published | 2020-10-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 238.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 652 |
| Author | Alejandro Tardín |
| Maintainers | 4lejandrito |
| Keywords | react, guitar, sound |

## Links

- npm: https://www.npmjs.com/package/react-guitar-sound
- Repository: https://github.com/4lejandrito/react-guitar.git#master
- Homepage: https://react-guitar.com
- Issues: https://github.com/4lejandrito/react-guitar/issues
- Funding: https://github.com/4lejandrito/react-guitar?sponsor=1
- npm.io page: https://npm.io/package/react-guitar-sound

## Dependencies (2)

- [tone](https://npm.io/package/tone.md) ^14.7.77
- [soundfont-player](https://npm.io/package/soundfont-player.md) ^0.12.0

## 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.1.5 (latest) — 2026-01-06
- 1.1.4 — 2026-01-06
- 1.1.3 — 2026-01-04
- 1.1.2 — 2022-10-11
- 1.1.0 — 2021-08-11
- 1.0.3 — 2021-02-07
- 1.0.2 — 2020-12-14
- 1.0.1 — 2020-11-29
- 1.0.0 — 2020-11-29
- 0.12.0 — 2020-11-27
- 0.11.2 — 2020-10-08
- 0.11.1 — 2020-10-07
- 0.11.0 — 2020-10-07

## README

# React-Guitar-Sound &middot; [![npm version](https://img.shields.io/npm/v/react-guitar-sound.svg?style=flat)](https://www.npmjs.com/package/react-guitar)

A React Hook to play sound with react-guitar.

See https://react-guitar.com for a live demo.

**For the full documentation go to the [root README](https://github.com/4lejandrito/react-guitar).**

[![Edit quizzical-dawn-0hzuq](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/interesting-breeze-ll7zh)

## Usage

```
npm i react-guitar react-guitar-sound react-guitar-tunings
```

```jsx
import React, { useMemo } from 'react'
import { render } from 'react-dom'
import Guitar from 'react-guitar'
import { standard } from 'react-guitar-tunings'
import useSound from 'react-guitar-sound'

function SampleGuitarWithSound() {
  const strings = useMemo(() => [0, 1, 2, 2, 0, -1], [])
  const { play, strum } = useSound({ fretting: strings, tuning: standard })

  return <Guitar strings={strings} onPlay={play} />
}

render(<SampleGuitarWithSound />, document.getElementById('root'))
```

## Developing

- `yarn start` will watch and rebuild.
- `yarn build` will generate the production scripts under the `dist` folder.

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