mr-component
Version:
A library for Mr components
95 lines (94 loc) • 2.73 kB
TypeScript
import * as React from 'react';
import { ReactNode } from 'react';
export interface CardAction {
/** 按钮文本 */
text: string;
/** 按钮类型 */
type?: 'primary' | 'success' | 'warning' | 'danger' | 'default';
/** 按钮尺寸 */
size?: 'small' | 'normal' | 'large';
/** 是否禁用 */
disabled?: boolean;
/** 点击回调 */
onClick?: () => void;
/** 自定义样式 */
style?: React.CSSProperties;
}
export interface MrCardProps {
/** 卡片标题 */
title?: string;
/** 卡片副标题 */
subtitle?: string;
/** 卡片内容 */
content?: string;
/** 卡片描述 */
description?: string;
/** 卡片图片 */
image?: string;
/** 图片位置 */
imagePosition?: 'top' | 'left' | 'right' | 'bottom';
/** 图片尺寸 */
imageSize?: 'small' | 'medium' | 'large';
/** 图片圆角 */
imageRound?: boolean;
/** 徽标/标签 */
badge?: string;
/** 徽标颜色 */
badgeColor?: string;
/** 操作按钮列表 */
actions?: CardAction[];
/** 操作按钮布局 */
actionLayout?: 'horizontal' | 'vertical';
/** 是否可点击 */
clickable?: boolean;
/** 是否显示阴影 */
shadow?: boolean;
/** 是否显示边框 */
bordered?: boolean;
/** 是否圆角 */
round?: boolean;
/** 自定义头部内容 */
header?: ReactNode;
/** 自定义底部内容 */
footer?: ReactNode;
/** 自定义内容 */
children?: ReactNode;
/** 边框颜色 */
borderColor?: string;
/** 背景颜色 */
backgroundColor?: string;
/** 文字颜色 */
textColor?: string;
/** 圆角大小 */
borderRadius?: number | string;
/** 内边距 */
padding?: number | string;
/** 阴影样式 */
shadowStyle?: string;
/** 标题字体大小 */
titleFontSize?: number | string;
/** 标题字体粗细 */
titleFontWeight?: number | string;
/** 标题颜色 */
titleColor?: string;
/** 内容字体大小 */
contentFontSize?: number | string;
/** 内容颜色 */
contentColor?: string;
/** 间距 */
spacing?: number | string;
/** 预设主题 */
theme?: 'default' | 'primary' | 'success' | 'warning' | 'danger';
/** 尺寸 */
size?: 'small' | 'normal' | 'large';
/** 卡片变体 */
variant?: 'basic' | 'product' | 'profile' | 'article' | 'media';
/** 点击回调 */
onClick?: () => void;
/** 自定义类名 */
className?: string;
/** 自定义样式 */
style?: React.CSSProperties;
}
declare const RefMrCard: React.ForwardRefExoticComponent<MrCardProps & React.RefAttributes<HTMLDivElement>>;
export default RefMrCard;