Function ControlButtonsComponentTouch

ControlButtonsComponentTouch is a React functional component that renders a customizable set of control buttons with flexible styling, positioning, and layout options.

This component supports various button configurations, including custom icons, background colors, and dynamic display settings. It can be positioned horizontally or vertically with alignment control.

import React from 'react';
import { ControlButtonsComponentTouch } from 'mediasfu-reactjs';
import { faPlay, faPause } 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" },
},
];

return (
<ControlButtonsComponentTouch
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'