lune-ui-lib
Version:
Lune UI Components Library
41 lines (40 loc) • 1.31 kB
TypeScript
import type { SxProps } from '@mui/material';
import { FC } from 'react';
export interface MediaProps {
src: string;
type: 'image' | 'video';
alt?: string;
placeholderSrc?: string;
dynamicPlaceholder?: {
width: number;
height: number;
color?: string;
};
width?: number;
height?: number;
key?: string;
sx?: SxProps;
autoPlay?: boolean;
muted?: boolean;
loop?: boolean;
backgroundImage?: boolean;
onLoad?: (loaded: boolean) => void;
}
/**
* Media component
* @param src - main image source
* @param type - media type -> image or video
* @param placeholderSrc - placeholder image source
* @param dynamicPlaceholder - setting an autogenerated placeholder with specific width, height and color(optional)
* @param alt - default image and video alt prop
* @param sx - custom style that applies to dropdown button
* @param width - media width
* @param height - media height
* @param key - default key prop
* @param autoPlay - video specific -> default video autoplay prop
* @param loop - video specific -> default video loop prop
* @param muted - video specific -> default video muted prop
* @param backgroundImage - setting image as a background image
*/
declare const Media: FC<MediaProps>;
export default Media;