UNPKG

1.18 kBTypeScriptView Raw
1import * as React from 'react';
2import { OverridableComponent, OverrideProps } from '../OverridableComponent';
3
4export interface CardMediaTypeMap<P, D extends React.ElementType> {
5 props: P & {
6 /**
7 * The content of the component.
8 */
9 children?: React.ReactNode;
10 /**
11 * Image to be displayed as a background image.
12 * Either `image` or `src` prop must be specified.
13 * Note that caller must specify height otherwise the image will not be visible.
14 */
15 image?: string;
16 /**
17 * An alias for `image` property.
18 * Available only with media components.
19 * Media components: `video`, `audio`, `picture`, `iframe`, `img`.
20 */
21 src?: string;
22 };
23 defaultComponent: D;
24 classKey: CardMediaClassKey;
25}
26
27/**
28 *
29 * Demos:
30 *
31 * - [Cards](https://mui.com/components/cards/)
32 *
33 * API:
34 *
35 * - [CardMedia API](https://mui.com/api/card-media/)
36 */
37declare const CardMedia: OverridableComponent<CardMediaTypeMap<{}, 'div'>>;
38
39export type CardMediaClassKey = 'root' | 'media';
40
41export type CardMediaProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<
42 CardMediaTypeMap<P, D>,
43 D
44>;
45
46export default CardMedia;