UNPKG

1.56 kBTypeScriptView Raw
1import * as React from 'react';
2import { SxProps } from '@mui/system';
3import { DistributiveOmit } from '@mui/types';
4import { OverridableComponent, OverrideProps } from '@mui/material/OverridableComponent';
5import { Theme } from '..';
6import { PaperOwnProps } from '../Paper';
7import { CardClasses } from './cardClasses';
8
9// TODO: v6 remove this interface, it is not used
10export interface CardPropsColorOverrides {}
11
12export interface CardOwnProps extends DistributiveOmit<PaperOwnProps, 'classes'> {
13 /**
14 * Override or extend the styles applied to the component.
15 */
16 classes?: Partial<CardClasses>;
17 /**
18 * If `true`, the card will use raised styling.
19 * @default false
20 */
21 raised?: boolean;
22 /**
23 * The system prop that allows defining system overrides as well as additional CSS styles.
24 */
25 sx?: SxProps<Theme>;
26}
27
28export interface CardTypeMap<
29 AdditionalProps = {},
30 RootComponent extends React.ElementType = 'div',
31> {
32 props: AdditionalProps & CardOwnProps;
33 defaultComponent: RootComponent;
34}
35
36/**
37 *
38 * Demos:
39 *
40 * - [Card](https://mui.com/material-ui/react-card/)
41 *
42 * API:
43 *
44 * - [Card API](https://mui.com/material-ui/api/card/)
45 * - inherits [Paper API](https://mui.com/material-ui/api/paper/)
46 */
47
48declare const Card: OverridableComponent<CardTypeMap>;
49
50export type CardProps<
51 RootComponent extends React.ElementType = CardTypeMap['defaultComponent'],
52 AdditionalProps = {},
53> = OverrideProps<CardTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
54 component?: React.ElementType;
55};
56
57export default Card;