UNPKG

@mui/material

Version:

Quickly build beautiful React apps. MUI is a simple and customizable component library to build faster, beautiful, and more accessible React applications. Follow your own design system, or start with Material Design.

128 lines (122 loc) 3.73 kB
import * as React from 'react'; import { SxProps } from '@mui/system'; import { TypographyProps } from '../Typography'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { Theme } from '..'; import { CardHeaderClasses } from './cardHeaderClasses'; export interface CardHeaderTypeMap< Props = {}, DefaultComponent extends React.ElementType = 'div', TitleTypographyComponent extends React.ElementType = 'span', SubheaderTypographyComponent extends React.ElementType = 'span', > { props: Props & { /** * The action to display in the card header. */ action?: React.ReactNode; /** * The Avatar element to display. */ avatar?: React.ReactNode; /** * Override or extend the styles applied to the component. */ classes?: Partial<CardHeaderClasses>; /** * If `true`, `subheader` and `title` won't be wrapped by a Typography component. * This can be useful to render an alternative Typography variant by wrapping * the `title` text, and optional `subheader` text * with the Typography component. * @default false */ disableTypography?: boolean; /** * The content of the component. */ subheader?: React.ReactNode; /** * These props will be forwarded to the subheader * (as long as disableTypography is not `true`). */ subheaderTypographyProps?: TypographyProps< SubheaderTypographyComponent, { component?: SubheaderTypographyComponent } >; /** * The system prop that allows defining system overrides as well as additional CSS styles. */ sx?: SxProps<Theme>; /** * The content of the component. */ title?: React.ReactNode; /** * These props will be forwarded to the title * (as long as disableTypography is not `true`). */ titleTypographyProps?: TypographyProps< TitleTypographyComponent, { component?: TitleTypographyComponent } >; }; defaultComponent: DefaultComponent; } /** * * Demos: * * - [Cards](https://mui.com/components/cards/) * * API: * * - [CardHeader API](https://mui.com/api/card-header/) */ declare const CardHeader: OverridableCardHeader; export interface OverridableCardHeader extends OverridableComponent<CardHeaderTypeMap> { < DefaultComponent extends React.ElementType = CardHeaderTypeMap['defaultComponent'], Props = {}, TitleTypographyComponent extends React.ElementType = 'span', SubheaderTypographyComponent extends React.ElementType = 'span', >( props: CardHeaderPropsWithComponent< DefaultComponent, Props, TitleTypographyComponent, SubheaderTypographyComponent >, ): JSX.Element; } export type CardHeaderProps< DefaultComponent extends React.ElementType = CardHeaderTypeMap['defaultComponent'], Props = {}, TitleTypographyComponent extends React.ElementType = 'span', SubheaderTypographyComponent extends React.ElementType = 'span', > = OverrideProps< CardHeaderTypeMap< Props, DefaultComponent, TitleTypographyComponent, SubheaderTypographyComponent >, DefaultComponent >; export type CardHeaderPropsWithComponent< DefaultComponent extends React.ElementType = CardHeaderTypeMap['defaultComponent'], Props = {}, TitleTypographyComponent extends React.ElementType = 'span', SubheaderTypographyComponent extends React.ElementType = 'span', > = { /** * The component used for the root node. * Either a string to use a HTML element or a component. */ component?: DefaultComponent; } & CardHeaderProps< DefaultComponent, Props, TitleTypographyComponent, SubheaderTypographyComponent >; export default CardHeader;