ConstThe participant's initials to display (e.g., "JD" for John Doe). Shown when no imageSource is provided.
Source URL for the participant's profile image. Takes precedence over initials.
Custom render function for the container. Receives { defaultContainer, isImage }.
Custom render function for the image. Receives { defaultImage, imageSource }.
Custom render function for the initials. Receives { defaultInitials, initials }.
Basic Usage (Initials)
import React from 'react';
import { MiniCard } from 'mediasfu-reactjs';
function App() {
return (
<MiniCard
initials="JD"
fontSize={16}
customStyle={{ backgroundColor: 'blue', color: 'white' }}
/>
);
}
Basic Usage (Profile Image)
import React from 'react';
import { MiniCard } from 'mediasfu-reactjs';
function App() {
return (
<MiniCard
imageSource="https://example.com/avatar.jpg"
roundedImage={true}
imageStyle={{ border: '2px solid gold' }}
/>
);
}
Custom Initials Renderer
import React from 'react';
import { MiniCard } from 'mediasfu-reactjs';
function App() {
return (
<MiniCard
initials="AB"
renderInitials={({ defaultInitials, initials }) => (
<div style={{
background: 'linear-gradient(45deg, purple, pink)',
borderRadius: '50%',
padding: 10,
color: 'white',
fontWeight: 'bold'
}}>
{initials}
</div>
)}
/>
);
}
Using in uiOverrides (MediasfuGeneric example)
import React from 'react';
import { MediasfuGeneric, MiniCard } from 'mediasfu-reactjs';
function App() {
const CustomMiniCard = (props: any) => (
<MiniCard
{...props}
fontSize={18}
roundedImage={false}
renderContainer={({ defaultContainer, isImage }) => (
<div style={{
border: '3px solid cyan',
boxShadow: '0 0 10px cyan',
padding: 5,
borderRadius: isImage ? 0 : '50%'
}}>
{defaultContainer}
</div>
)}
/>
);
return (
<MediasfuGeneric
useLocalUIMode={true}
useSeed={true}
seedData={mySeedData}
uiOverrides={{
MiniCard: CustomMiniCard
}}
/>
);
}
MiniCard displays either participant initials or a profile image inside a small, reusable card.
This lightweight component is commonly used as a fallback for participant avatars when no full image is available. It supports: