UNPKG

@amsterdam/design-system-react

Version:

All React components from the Amsterdam Design System. Use it to compose pages in your website or application.

11 lines (10 loc) 684 B
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { clsx } from 'clsx'; import { forwardRef } from 'react'; import { Icon } from '../Icon'; export const badgeColors = ['azure', 'lime', 'magenta', 'orange', 'purple', 'red', 'yellow']; /** * @see {@link https://designsystem.amsterdam/?path=/docs/components-feedback-badge--docs Badge docs at Amsterdam Design System} */ export const Badge = forwardRef(({ className, color, icon, label, ...restProps }, ref) => (_jsxs("span", { ...restProps, className: clsx('ams-badge', color && `ams-badge--${color}`, className), ref: ref, children: [icon && _jsx(Icon, { svg: icon }), label] }))); Badge.displayName = 'Badge';