ControlButtonsAltComponent renders a set of customizable control buttons with adjustable layout, styling, and alignment options.

This component displays a collection of control buttons that can be horizontally or vertically aligned, with additional options to define icon behavior, active states, and color schemes. Each button can have an icon, alternate icon, or custom component.

import React from 'react';
import { ControlButtonsAltComponent } 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 (
<ControlButtonsAltComponent
buttons={buttons}
position="middle"
location="bottom"
direction="horizontal"
showAspect={true}
/>
);
}

export default App;

Properties

propTypes?: WeakValidationMap<ControlButtonsAltComponentOptions>

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

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'