@gravity-ui/uikit
Version:
Gravity UI base styling and components
39 lines (38 loc) • 1.42 kB
TypeScript
import * as React from 'react';
import type { QAProps } from "../types.js";
import "./Label.css";
export interface LabelProps extends QAProps {
/** Label icon (at start) */
icon?: React.ReactNode;
/** Disabled state */
disabled?: boolean;
/** Handler for click on close button */
onCloseClick?(event: React.MouseEvent<HTMLButtonElement>): void;
/** Text to copy */
copyText?: string;
/** `aria-label` of close button */
closeButtonLabel?: string;
/** `aria-label` of copy button */
copyButtonLabel?: string;
/** Handler for copy event */
onCopy?(text: string, result: boolean): void;
/** Handler for click on label itself */
onClick?(event: React.MouseEvent<HTMLElement>): void;
/** Class name */
className?: string;
/** Content */
children?: React.ReactNode;
/** Display hover */
interactive?: boolean;
/** Label value (shows as "children : value") */
value?: string;
/** Label color */
theme?: 'normal' | 'info' | 'danger' | 'warning' | 'success' | 'utility' | 'unknown' | 'clear';
/** Label type (plain, with copy text button or with close button) */
type?: 'default' | 'copy' | 'close';
/** Label size */
size?: 'xs' | 's' | 'm';
/** Browser title for Label */
title?: string;
}
export declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLDivElement>>;