UNPKG

doly-icons

Version:

React icon component based on Bootstrap Icons

31 lines (30 loc) 1.06 kB
import React, { CSSProperties, HTMLAttributes, SVGProps, ReactNode, RefObject } from 'react'; type StyleWithVariable<V extends string = never> = CSSProperties & Partial<Record<V, string>>; export interface IconBaseProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'style' | 'children'> { /** * @description 旋转动画。 * @default false */ spin?: boolean; /** * @description 反向旋转动画,优先级比 spin 高。 * @default false */ spinReverse?: boolean; /** * @description svg 标签属性。 */ svgProps?: SVGProps<SVGSVGElement>; style?: StyleWithVariable<'--doly-icon-font-size' | '--doly-icon-color' | '--doly-icon-spin-duration'>; ref?: RefObject<HTMLSpanElement>; } declare const IconBase: React.FC<IconBaseProps & { /** * 自定义渲染子节点。 * * @param childProps 合并上下文配置和组件配置的 `svgProps`。 * @returns */ renderChild: (childProps: SVGProps<SVGSVGElement>) => ReactNode; }>; export default IconBase;