@commercetools-uikit/label
Version:
The Label component represents the primitive label for a form field component.
58 lines (57 loc) • 1.76 kB
TypeScript
import type { Props as IntlMessage } from 'react-intl/src/components/message';
import { type ReactNode } from 'react';
export type TLabelProps = {
/**
* The `id` HTML attribute, used to reference non-form elements with the related attribute `aria-labelledby`.
* <br/>
* Use this to set the relationships between the label and a non-form element.
* <br />
* For example:
* ````
* <label id="foo">
* <div aria-labelledby="foo">
* ````
*/
id?: string;
/**
* The `for` HTML attribute, used to reference form elements with the related attribute `id` or `aria-labelledby`.
* <br />
* Use this to set the relationships between the label and a form element.
* <br />
* For example:
* ````
* <label for="foo">
* <input id="foo">
*
* <label id="foo">
* <input aria-labelledby="foo">
* ````
*/
htmlFor?: string;
fontWeight?: 'medium' | 'bold';
/**
* @deprecated: Use the new `fontWeight` prop.
*/
isBold?: boolean;
isRequiredIndicatorVisible?: boolean;
tone?: 'primary' | 'inverted';
/**
* An `IntlMessage` object rendered `children` to `Label`.
* <br />
* When a value is provided, `intlMessage` will be rendered instead of `children`
* <br />
* This is required when `children` is `undefined` and vice versa
*/
intlMessage?: IntlMessage;
/**
* Rendered as `children` to `Label`.
* <br />
* This is required when `intlMessage` is `undefined` and vice versa
*/
children?: ReactNode;
};
declare const Label: {
(props: TLabelProps): import("@emotion/react/jsx-runtime").JSX.Element;
displayName: string;
};
export default Label;