ControlButtonsComponent renders a set of customizable control buttons with options for layout, style, and alignment.

This component supports flexible alignment, background colors, vertical/horizontal orientation, and custom icon behavior. Each button can display an icon, alternate icon, or a custom component with active and disabled states.

import React from 'react';
import { ControlButtonsComponent } from 'mediasfu-reactnative-expo';

function App() {
const buttons = [
{ name: 'Play', icon: 'play', onPress: () => console.log('Play pressed'), active: true },
{ name: 'Stop', icon: 'stop', onPress: () => console.log('Stop pressed') }
];

return (
<ControlButtonsComponent
buttons={buttons}
alignment="center"
buttonBackgroundColor={{ default: '#333', pressed: '#555' }}
vertical={false}
/>
);
}

export default App;

Properties

propTypes?: WeakValidationMap<ControlButtonsComponentOptions>

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<ControlButtonsComponentOptions>

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'