@eccenca/gui-elements
Version:
GUI elements based on other libraries, usable in React application, written in Typescript.
42 lines (41 loc) • 1.52 kB
TypeScript
import React from "react";
import { TooltipProps } from "../Tooltip/Tooltip";
export interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
/**
* Label text.
*/
text?: string | JSX.Element;
/**
* Short info about label semantic, it is displayed in parentesis after the label text.
*/
info?: string | JSX.Element;
/**
* Additional tooltip, attached to an info icon that is displayed after the info.
*/
tooltip?: string | JSX.Element;
/**
* Additonal tooltip properties, e.g. `hoverOpenDelay`.
*/
tooltipProps?: Partial<Omit<TooltipProps, "content" | "children" | "disabled">>;
/**
* Set the name of an HTML element if the display should be used for something else that a `label` element.
*/
isLayoutForElement?: string;
/**
* Label is displayed inactive.
* If there is no `isLayoutForElement` set then a `span` is used.
*/
disabled?: boolean;
/**
* visual appearance of the label
*/
emphasis?: "strong" | "normal";
/**
* Add other elements to the end of the label content
*/
additionalElements?: React.ReactNode | React.ReactNode[];
/** Force label to get displayed as inline block element. */
inline?: boolean;
}
export declare const Label: ({ children, className, disabled, text, info, tooltip, tooltipProps, isLayoutForElement, emphasis, additionalElements, inline, ...otherLabelProps }: LabelProps) => React.JSX.Element;
export default Label;