carbon-react
Version:
A library of reusable React components for easily building user interfaces.
26 lines (25 loc) • 1.15 kB
TypeScript
import React from "react";
import { MarginProps } from "styled-system";
import { TagProps } from "../../__internal__/utils/helpers/tags/tags";
export interface BadgeProps extends TagProps, MarginProps {
/** @deprecated Prop to specify an aria-label for the component */
"aria-label"?: string;
/** The badge will be positioned relative to this element */
children?: React.ReactNode;
/** The number rendered in the badge component */
counter?: string | number;
/** @deprecated Prop to specify the color of the component */
color?: string;
/** @deprecated Callback fired when badge is clicked */
onClick?: (ev: React.MouseEvent<HTMLElement>) => void;
/** Unique identifier for the component. */
id?: string;
/** Size of the badge */
size?: "small" | "medium" | "large";
/** Badge variant */
variant?: "typical" | "subtle";
/** Set the style of the Badge to inverse */
inverse?: boolean;
}
export declare const Badge: ({ "aria-label": ariaLabel, children, counter, color, onClick, id, size, variant, inverse, ...rest }: BadgeProps) => React.JSX.Element | null;
export default Badge;