@stratakit/bricks
Version:
Small, modular components for StrataKit
36 lines (35 loc) • 1.09 kB
TypeScript
import type { BaseProps } from "@stratakit/foundations/secret-internals";
interface BadgeProps extends Omit<BaseProps<"span">, "children"> {
/**
* The label displayed inside the badge.
*/
label: React.ReactNode;
/**
* The tone of the badge.
* @default "neutral"
*/
tone?: "neutral" | "info" | "positive" | "attention" | "critical" | "accent";
/**
* The variant style of the badge.
* @default "solid"
*/
variant?: "solid" | "muted" | "outline";
/**
* Icon to be displayed at the start of the badge.
*
* Can be a URL of an SVG from the `@stratakit/icons` package,
* or a custom JSX icon.
*/
icon?: string | React.JSX.Element;
}
/**
* A badge component, typically used to designate the status of an item.
*
* Example:
* ```tsx
* <Badge label="Value" />
* <Badge label="Value" tone="info" variant="outline" icon={…} />
* ```
*/
declare const Badge: import("react").ForwardRefExoticComponent<BadgeProps & import("react").RefAttributes<HTMLElement | HTMLSpanElement>>;
export default Badge;