UNPKG

@szum-tech/design-system

Version:

Szum-Tech design system with tailwindcss support

21 lines (18 loc) 790 B
import * as React from 'react'; interface GetBadgeLabel<T> { /** * Callback that returns a label string for each badge item. * Optional for primitive arrays (strings, numbers), required for object arrays. * @example getBadgeLabel={(item) => item.name} */ getBadgeLabel: (item: T) => string; } type BadgeOverflowProps<T = string> = React.ComponentProps<"div"> & (T extends object ? GetBadgeLabel<T> : Partial<GetBadgeLabel<T>>) & { items: T[]; lineCount?: number; renderBadge: (item: T, label: string) => React.ReactNode; renderOverflow?: (count: number) => React.ReactNode; asChild?: boolean; }; declare function BadgeOverflow<T = string>(props: BadgeOverflowProps<T>): React.JSX.Element; export { BadgeOverflow, type BadgeOverflowProps };