@nutui/nutui-react
Version:
京东风格的轻量级移动端 React 组件库,支持一套代码生成 H5 和小程序
42 lines (41 loc) • 1.05 kB
TypeScript
import { FunctionComponent, ReactNode } from 'react';
import { BasicComponent } from '../../utils/typings';
export type BadgeFill = 'solid' | 'outline';
export interface BadgeProps extends BasicComponent {
/**
* 显示的内容,支持数字、字符和自定义内容
* @default -
*/
value: ReactNode
/**
* 是否为小点,当value值为自定义内容时,dot不生效
* @default false
*/
dot: boolean
/**
* value 为数值时,最大值
* @default 99
*/
max: number
/**
* 上下偏移量,支持单位设置,可设置为:"0"或0 等
* @default "0"
*/
top: string | number
/**
* 左右偏移量,支持单位设置,可设置为:"5"或5 等
* @default "5"
*/
right: string | number
/**
* 徽标背景颜色,默认值为当前主题色
* @default -
*/
color: string
/**
* 填充模式
* @default solid
*/
fill: BadgeFill
}
export declare const Badge: FunctionComponent<Partial<BadgeProps>>;