UNPKG

sailboat-design

Version:
40 lines (39 loc) 1.35 kB
/// <reference types="react" /> export declare type ButtonSize = 'lg' | 'sm' | 'md'; export declare type ButtonType = 'primary' | 'default' | 'danger' | 'link'; interface BaseButtonProps { className?: string; /** 设置 Button 的禁用 */ disabled?: boolean; /** 设置 Button 的尺寸 */ size?: ButtonSize; /** 设置 Button 的类型 */ btnType?: ButtonType; children: React.ReactNode; /** 设置 Button 的跳转链接 */ href?: string; } declare type NativeButtonProps = React.ButtonHTMLAttributes<HTMLElement>; declare type AnchorButtonProps = React.AnchorHTMLAttributes<HTMLElement>; export declare type ButtonProps = Partial<BaseButtonProps & NativeButtonProps & AnchorButtonProps>; /** * 页面中最常用的的按钮元素, 支持HTML button 和 a 链接 * ### 引用方法 * ~~~js * import { Button } from '@sailboat'; * ~~~ * 按钮可以展示用户能进行的操作。 他们通常直接放置在您的用户界面中,例如: * * Modal windows(模态窗口) * * Forms(表单) * * Cards(卡片) * * Toolbars(工具栏) */ export declare const Button: { (props: ButtonProps): JSX.Element; defaultProps: { disabled: boolean; btnType: string; size: string; }; }; export default Button;