UNPKG

primereact

Version:

PrimeReact is an open source UI library for React featuring a rich set of 90+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with Prime

100 lines (94 loc) 2.76 kB
/** * * Badge represents people using icons, labels and images. * * [Live Demo](https://www.primereact.org/badge) * * @module badge * */ import * as React from 'react'; import { ComponentHooks } from '../componentbase/componentbase'; import { PassThroughOptions } from '../passthrough'; import { PassThroughType } from '../utils/utils'; export declare type BadgePassThroughType<T> = PassThroughType<T, BadgePassThroughMethodOptions>; /** * Custom passthrough(pt) option method. */ export interface BadgePassThroughMethodOptions { props: BadgeProps; } /** * Custom passthrough(pt) options. * @see {@link BadgeProps.pt} */ export interface BadgePassThroughOptions { /** * Uses to pass attributes to the root's DOM element. */ root?: BadgePassThroughType<React.HTMLAttributes<HTMLSpanElement>>; /** * Used to manage all lifecycle hooks * @see {@link ComponentHooks} */ hooks?: ComponentHooks; } /** * Defines valid properties in Badge component. In addition to these, all properties of HTMLSpanElement can be used in this component. * @group Properties */ export interface BadgeProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, 'ref'> { /** * Value to display inside the badge. * */ value?: any | null | undefined; /** * Severity type of the badge. * @defaultValue null */ severity?: 'success' | 'info' | 'warning' | 'danger' | 'secondary' | 'contrast' | null | undefined; /** * Size of the badge, valid options are "large" and "xlarge". * @defaultValue null */ size?: 'normal' | 'large' | 'xlarge' | null | undefined; /** * Used to get the child elements of the component. * @readonly */ children?: React.ReactNode | undefined; /** * Uses to pass attributes to DOM elements inside the component. * @type {BadgePassThroughOptions} */ pt?: BadgePassThroughOptions; /** * Used to configure passthrough(pt) options of the component. * @type {PassThroughOptions} */ ptOptions?: PassThroughOptions; /** * When enabled, it removes component related styles in the core. * @defaultValue false */ unstyled?: boolean; } /** * **PrimeReact - Badge** * * _Badge represents people using icons, labels and images._ * * [Live Demo](https://www.primereact.org/badge/) * --- --- * ![PrimeReact](https://primefaces.org/cdn/primereact/images/logo-100.png) * * @group Component */ export declare class Badge extends React.Component<BadgeProps, any> { /** * Used to get container element. * @return {HTMLSpanElement} Container element */ public getElement(): HTMLSpanElement; }