UNPKG

@cn-ui/core

Version:

The @cn-ui/core is a collection of UI components and utilities for building modern web applications with SolidJS.

53 lines (52 loc) 1.59 kB
import { type FloatingCoverProps } from "@cn-ui/reactive"; import { type JSX, type JSXElement } from "solid-js"; /** * 定义 Badge 组件的属性接口。 * Badge 组件用于展示一个小红点或者数字,可自定义颜色、大小、样式等。 */ export interface BadgeProps extends FloatingCoverProps { /** * 自定义小圆点的颜色。 * @type string */ color?: string; /** * 展示的数字,大于 overflowCount 时显示为 +,为 0 时隐藏。 * @type ReactNode */ count?: JSXElement | number; /** * 不展示数字,只有一个小红点。 * @type boolean * @default false */ dot?: boolean; /** * 设置状态点的 style */ dotStyle?: JSX.CSSProperties; /** * 展示封顶的数字值,超过该值则显示为 +。 * @type number * @default 99 */ overflowCount?: number; /** * 当数值为 0 时,是否展示 Badge。 * @type boolean * @default false */ showZero?: boolean; /** * 设置 Badge 为状态点,可选值为 success、processing、default、error、warning。 * @type 'success' | 'processing' | 'default' | 'error' | 'warning' * @dev */ status?: "success" | "processing" | "default" | "error" | "warning"; /** * 设置鼠标放在状态点上时显示的文字。 * @type string */ title?: string; } export declare const Badge: import("solid-js").Component<import("@cn-ui/reactive").OriginComponentOutputType<BadgeProps, HTMLElement, string>>;