UNPKG

carbon-react

Version:

A library of reusable React components for easily building user interfaces.

36 lines (35 loc) 1.88 kB
import React from "react"; import { StyledLabelProps, StyledLabelContainerProps } from "./label.style"; import { ValidationProps } from "../validations"; import { IconType } from "../../components/icon"; export interface LabelProps extends ValidationProps, StyledLabelProps, StyledLabelContainerProps { as?: "span" | "label"; /** Children elements */ children?: React.ReactNode; /** A message that the Help component will display */ help?: React.ReactNode; /** Icon type */ helpIcon?: IconType; /** A string that represents the ID of another form element */ htmlFor?: string; /** The unique id of the label element */ labelId?: string; /** The unique id of the Help component tooltip, used for accessibility */ tooltipId?: string; /** Whether to show the validation icon */ useValidationIcon?: boolean; /** Id of the validation icon */ validationIconId?: string; /** * @private * @internal * Sets className for component. INTERNAL USE ONLY. */ className?: string; /** Sets aria-label for label element */ "aria-label"?: string; /** Whether this component is shown against a dark background */ isDarkBackground?: boolean; } export declare const Label: ({ align, as, children, disabled, error, help, helpIcon, htmlFor, info, inline, isDarkBackground, isRequired, labelId, pr, pl, tooltipId, useValidationIcon, validationIconId, warning, width, className, "aria-label": ariaLabel, isLarge, }: LabelProps) => React.JSX.Element; declare const _default: React.MemoExoticComponent<({ align, as, children, disabled, error, help, helpIcon, htmlFor, info, inline, isDarkBackground, isRequired, labelId, pr, pl, tooltipId, useValidationIcon, validationIconId, warning, width, className, "aria-label": ariaLabel, isLarge, }: LabelProps) => React.JSX.Element>; export default _default;