UNPKG

@engie-group/fluid-design-system-react

Version:

Fluid Design System React

47 lines (46 loc) 1.25 kB
import React from 'react'; import { TEmphasisVariants, TNeutralExtendedSemanticVariants, TSizeVariants } from '../../global'; export declare const NJBadge: React.ForwardRefExoticComponent<IBadgeProps & React.RefAttributes<HTMLDivElement>>; export interface IBadgeProps extends React.PropsWithChildren { /** * Badge color variant **/ variant?: TNeutralExtendedSemanticVariants; /** * Badge emphasis **/ emphasis?: TEmphasisVariants; /** * Whether badge content is forced to uppercase or not **/ isUppercase?: boolean; /** * When value is a number, you can pass a capedValue, so the displayed value will be ${capedValue}+ * If the value is < 0, will display 0 **/ capedValue?: number; /** * Badge size **/ size?: Extract<TSizeVariants, 'sm' | 'md' | 'lg'>; /** * Optional additional className **/ className?: string; /** * Screen reader only unit label. * * @example * // read as "12 notifications" * <NJBadge unitLabel="notifications">12</NJBadge> */ unitLabel?: string; /** * Material icon name */ iconName?: string; /** * Custom icon */ icon?: React.ReactNode; }