UNPKG

@douyinfe/semi-ui

Version:

A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.

80 lines (79 loc) 2.96 kB
import React, { PureComponent, ReactNode, CSSProperties } from 'react'; import PropTypes from 'prop-types'; import '@douyinfe/semi-foundation/lib/es/card/card.css'; import Meta from './meta'; export type Shadows = 'hover' | 'always'; export type { MetaProps } from './meta'; export type { CardGroupProps } from './cardGroup'; export interface CardProps { /** Operation group at the bottom of the card content area */ actions?: ReactNode[]; /** Card content area inline style */ bodyStyle?: CSSProperties; /** Whether there is an outer border */ bordered?: boolean; /** Style class name */ className?: string; children?: React.ReactNode; /** Cover */ cover?: ReactNode; /** Additional additions to the right of the title */ headerExtraContent?: ReactNode; /** Custom end of page */ footer?: ReactNode; /** Whether there is an edge between the bottom of the page and the content area */ footerLine?: boolean; /** Inline style at the end of the page */ footerStyle?: CSSProperties; /** Custom head */ header?: ReactNode; /** Whether there is an edge line between the head and the content area */ headerLine?: boolean; /** Head inline style */ headerStyle?: CSSProperties; /** Whether to preload */ loading?: boolean; /** Set shadow */ shadows?: Shadows; /** Card inline style */ style?: CSSProperties; /** Title */ title?: ReactNode; /** aria label */ 'aria-label'?: string; } declare class Card extends PureComponent<CardProps> { static Meta: typeof Meta; static propTypes: { actions: PropTypes.Requireable<any[]>; bodyStyle: PropTypes.Requireable<object>; bordered: PropTypes.Requireable<boolean>; children: PropTypes.Requireable<PropTypes.ReactNodeLike>; className: PropTypes.Requireable<string>; cover: PropTypes.Requireable<PropTypes.ReactNodeLike>; footer: PropTypes.Requireable<PropTypes.ReactNodeLike>; footerLine: PropTypes.Requireable<boolean>; footerStyle: PropTypes.Requireable<object>; header: PropTypes.Requireable<PropTypes.ReactNodeLike>; headerExtraContent: PropTypes.Requireable<PropTypes.ReactNodeLike>; headerLine: PropTypes.Requireable<boolean>; headerStyle: PropTypes.Requireable<object>; loading: PropTypes.Requireable<boolean>; shadows: PropTypes.Requireable<string>; style: PropTypes.Requireable<object>; title: PropTypes.Requireable<PropTypes.ReactNodeLike>; 'aria-label': PropTypes.Requireable<string>; }; static defaultProps: { bordered: boolean; footerLine: boolean; headerLine: boolean; loading: boolean; }; renderHeader: () => ReactNode; renderCover: () => ReactNode; renderBody: () => ReactNode; renderFooter: () => ReactNode; render(): ReactNode; } export default Card;