UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

64 lines (63 loc) 1.96 kB
import React from 'react'; import type { SpacingProps } from '../../shared/types'; import type { SkeletonShow } from '../skeleton/Skeleton'; export type BadgeProps = { /** * The label description of the badge. Only required when passing a number as the badge content. */ label?: React.ReactNode; /** * Custom className on the component root * Default: `null` */ className?: string; /** * Applies loading skeleton. * Default: `false` */ skeleton?: SkeletonShow; /** * The content to display the badge on top of. * Default: `null` */ children?: React.ReactNode; /** * The content of the component. * Default: `null` */ content?: string | number | React.ReactNode; /** * The vertical positioning of the component. * Default: `null` */ vertical?: 'bottom' | 'top'; /** * The horizontal positioning of the component. * Default: `null` */ horizontal?: 'left' | 'right'; /** * The variant of the component. * Default: `information` */ variant?: 'information' | 'notification' | 'content'; /** * Defines the status color of the `"information"` variant. Has no effect on other variants. * Default: `default` */ status?: 'default' | 'neutral' | 'positive' | 'warning' | 'negative'; /** * Applies subtle style to `"information"` variant. Has no effect on other variants. * Default: `false` */ subtle?: boolean; /** * Removes the badge without removing children. Useful when Badge wraps content. * Default: `false` */ hideBadge?: boolean; }; export type BadgeAllProps = BadgeProps & SpacingProps & Omit<React.HTMLProps<HTMLElement>, 'content' | 'label'>; export declare const defaultProps: BadgeAllProps; declare function Badge(localProps: BadgeAllProps): import("react/jsx-runtime").JSX.Element; export default Badge;