UNPKG

test-nut-ui

Version:

<p align="center"> <img alt="logo" src="https://img11.360buyimg.com/imagetools/jfs/t1/211965/25/7152/22022/61b16785E433119bb/aa41d7a9f7e823f3.png" width="150" style="margin-bottom: 10px;"> </p>

73 lines (72 loc) 1.66 kB
import React from 'react'; import { BasicComponent } from '../../utils/typings'; import '@nascent/nutui-icons-react/lib/style.css'; export type ButtonType = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger'; export type ButtonSize = 'large' | 'normal' | 'small' | 'mini'; export type ButtonShape = 'square' | 'round'; export type ButtonFill = 'solid' | 'outline' | 'none'; export interface ButtonProps extends BasicComponent { /** * 按钮颜色,支持传入 linear-gradient 渐变色 * @default - */ color: string /** * 按钮的形状 * @default round */ shape: ButtonShape /** * 按钮的样式 * @default default */ type: ButtonType /** * 按钮的尺寸 * @default normal */ size: ButtonSize /** * 填充模式 * @default solid */ fill: ButtonFill /** * 是否为块级元素 * @default false */ block: boolean /** * 是否是朴素按钮 * @default false */ plain: boolean /** * icon的位置 * @default false */ iconPosition: 'left' | 'right' /** * 按钮loading状态 * @default false */ loading: boolean /** * 是否禁用按钮 * @default false */ disabled: boolean /** * 按钮图标 * @default - */ icon: React.ReactNode id: string; nativeType: 'submit' | 'reset' | 'button'; /** * 点击按钮时触发 * @default false */ onClick: (e: MouseEvent) => void } export declare const Button: React.ForwardRefExoticComponent<Partial<ButtonProps> & React.RefAttributes<HTMLButtonElement>>;