Audio
A wrapper around the HTML audio element
This is (currently) a simple wrapper around the HTML audio element.
It inverts a couple of the standards that the raw element has, such as showing controls by default.
You can provide either a src
prop with a path to a single file, or multiple
child <source>
elements. If you provide both, the src
prop will be ignored.
Props
Prop name | Type | Default | Description |
---|---|---|---|
children | union | null | The content of the Audio component. Should be a <source> element or React component that ultimately resolves in a <source> element |
className | string | null | A custom className you would like to pass to the Component |
hideControls | bool | false | Whether or not the controls should be hidden |
shouldAutoplay | bool | false | Whether or not the audio should play automatically |
shouldLoop | bool | false | Whether or not the audio file should be looped |
src | string | null | A path to a single source. Is ignored if children are passed in, as well. |