Function MiniCard

MiniAudio component displays an audio player with an optional waveform animation and draggable functionality.

This component provides a customizable audio display card that includes an animated waveform (optional) and a background image. The card can be dragged around the screen.

import React from 'react';
import { MiniAudio } from 'mediasfu-reactjs';

function App() {
return (
<MiniAudio
visible={true}
customStyle={{ backgroundColor: 'blue' }}
name="Sample Audio"
showWaveform={true}
barColor="green"
textColor="black"
nameTextStyling={{ fontSize: '20px' }}
imageSource="path/to/image.jpg"
roundedImage={true}
imageStyle={{ width: '100px' }}
overlayPosition="top"
/>
);
}

export default App;

Properties

propTypes?: WeakValidationMap<MiniCardOptions>

Used to declare the types of the props accepted by the component. These types will be checked during rendering and in development only.

We recommend using TypeScript instead of checking prop types at runtime.

contextTypes?: ValidationMap<any>

Lets you specify which legacy context is consumed by this component.

defaultProps?: Partial<MiniCardOptions>

Used to define default values for the props accepted by the component.

type Props = { name?: string }

const MyComponent: FC<Props> = (props) => {
return <div>{props.name}</div>
}

MyComponent.defaultProps = {
name: 'John Doe'
}
displayName?: string

Used in debugging messages. You might want to set it explicitly if you want to display a different name for debugging purposes.


const MyComponent: FC = () => {
return <div>Hello!</div>
}

MyComponent.displayName = 'MyAwesomeComponent'