MiniCard component displays a small card with either an image or initials, providing flexible styling options.

This component renders either an image or initials based on the provided props, supporting customizable font size, border radius, and additional styling for the card and image.

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

function App() {
return (
<MiniCard
initials="AB"
fontSize={18}
customStyle={{ backgroundColor: '#f0f0f0', borderRadius: 10 }}
imageSource="https://example.com/image.jpg"
roundedImage={true}
imageStyle={{ width: 50, height: 50 }}
/>
);
}

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'