Function ControlButtonsAltComponent

ControlButtonsAltComponent is a React functional component that renders a set of control buttons with customizable alignment, direction, and styling options.

This component accepts an array of button configurations, allowing each button to have custom icons, colors, and functionality, displayed in either horizontal or vertical layout.

import React from 'react';
import { ControlButtonsAltComponent } from 'mediasfu-reactjs';
import { faPlay, faPause, faStop } from '@fortawesome/free-solid-svg-icons';

function App() {
const buttons = [
{
name: 'Play',
icon: faPlay,
onPress: () => console.log('Play button pressed'),
backgroundColor: { default: 'green' },
active: true,
},
{
name: 'Pause',
icon: faPause,
onPress: () => console.log('Pause button pressed'),
backgroundColor: { default: 'red' },
},
{
name: 'Stop',
icon: faStop,
onPress: () => console.log('Stop button pressed'),
backgroundColor: { default: 'blue' },
},
];

return (
<ControlButtonsAltComponent
buttons={buttons}
position="left"
location="top"
direction="horizontal"
buttonsContainerStyle={{ padding: 10 }}
showAspect={true}
/>
);
}

export default App;

Properties

propTypes?: any

Ignored by React.

Only kept in types for backwards compatibility. Will be removed in a future major release.

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'