@ui5/webcomponents-react
Version:
React Wrapper for UI5 Web Components and additional components
66 lines (65 loc) • 2.79 kB
TypeScript
import '@ui5/webcomponents/dist/Label.js';
import type WrappingType from '@ui5/webcomponents/dist/types/WrappingType.js';
import type { CommonProps, Ui5DomRef } from '@ui5/webcomponents-react-base';
import type { ReactNode } from 'react';
interface LabelAttributes {
/**
* Defines the labeled input by providing its ID.
*
* **Note:** Can be used with both `Input` and native input.
* @default undefined
*/
for?: string | undefined;
/**
* Defines whether an asterisk character is added to the component text.
*
* **Note:** Usually indicates that user input (bound with the `for` property) is required.
* In that case the `required` property of
* the corresponding input should also be set.
* @default false
*/
required?: boolean;
/**
* Defines whether colon is added to the component text.
*
* **Note:** Usually used in forms.
* @default false
*/
showColon?: boolean;
/**
* Defines how the text of a component will be displayed when there is not enough space.
*
* **Note:** for option "Normal" the text will wrap and the words will not be broken based on hyphenation.
* @default "Normal"
*/
wrappingType?: WrappingType | keyof typeof WrappingType;
}
interface LabelDomRef extends Required<LabelAttributes>, Ui5DomRef {
}
interface LabelPropTypes extends LabelAttributes, Omit<CommonProps, keyof LabelAttributes | 'children'> {
/**
* Defines the text of the component.
*
* **Note:** Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.
*
* __Supported Node Type/s:__ `Array<Node>`
*/
children?: ReactNode | ReactNode[];
}
/**
* The `Label` is a component used to represent a label for elements like input, textarea, select.
* The `for` property of the `Label` must be the same as the id attribute of the related input element.
* Screen readers read out the label, when the user focuses the labelled control.
*
* The `Label` appearance can be influenced by properties,
* such as `required` and `wrappingType`.
* The appearance of the Label can be configured in a limited way by using the design property.
* For a broader choice of designs, you can use custom styles.
*
*
*
* __Note:__ This is a UI5 Web Component! [Label UI5 Web Component Documentation](https://ui5.github.io/webcomponents/components/Label) | [Repository](https://github.com/UI5/webcomponents)
*/
declare const Label: import("react").ForwardRefExoticComponent<LabelPropTypes & import("@ui5/webcomponents-react-base").WithWebComponentPropTypes & import("react").RefAttributes<LabelDomRef>>;
export { Label };
export type { LabelDomRef, LabelPropTypes };