UNPKG

@ui5/webcomponents-react

Version:

React Wrapper for UI5 Web Components and additional components

60 lines (59 loc) 3.22 kB
import '@ui5/webcomponents/dist/FormItem.js'; import type { CommonProps, Ui5DomRef, UI5WCSlotsNode } from '@ui5/webcomponents-react-base'; import type { ReactNode } from 'react'; interface FormItemAttributes { /** * Defines the column span of the component, * e.g how many columns the component should span to. * * **Note:** The column span should be a number between 1 and the available columns of the FormGroup (when items are placed in a group) * or the Form. The available columns can be affected by the FormGroup#columnSpan and/or the Form#layout. * A number bigger than the available columns won't take effect. * @default undefined * @deprecated As of version 2.23.0, this property is deprecated. **Note:** This property will not have any effect on the layout of the form item */ columnSpan?: number | undefined; } interface FormItemDomRef extends Required<FormItemAttributes>, Ui5DomRef { } interface FormItemPropTypes extends FormItemAttributes, Omit<CommonProps, keyof FormItemAttributes | 'children' | 'labelContent'> { /** * Defines the content of the component, * associated to `labelContent`. * * __Supported Node Type/s:__ `Array<HTMLElement>` */ children?: ReactNode | ReactNode[]; /** * Defines the label of the component. * * __Note:__ The content of the prop will be rendered into a [&lt;slot&gt;](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot) by assigning the respective [slot](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/slot) attribute (`slot="labelContent"`). * Since you can't change the DOM order of slots when declaring them within a prop, it might prove beneficial to manually mount them as part of the component's children, especially when facing problems with the reading order of screen readers. * * __Note:__ When passing a custom React component to this prop, you have to make sure your component reads the `slot` prop and appends it to the most outer element of your component. * Learn more about it [here](https://ui5.github.io/webcomponents-react/v2/?path=/docs/knowledge-base-handling-slots--docs). * * __Supported Node Type/s:__ `Array<HTMLElement>` */ labelContent?: UI5WCSlotsNode; } /** * The FormItem (ui5-form-item) represents pair of a label and * one or more components (text or text fields), associated to it. * * ### Usage * * The FormItem is being used in FormGroup (ui5-form-group) or directly in Form (ui5-form). * * ### ES6 Module Import * * - import @ui5/webcomponents/dist/FormItem.js"; * * __Note:__ This is a UI5 Web Component! [FormItem UI5 Web Component Documentation](https://ui5.github.io/webcomponents/components/FormItem) | [Repository](https://github.com/UI5/webcomponents) * * @since [2.0.0](https://github.com/UI5/webcomponents/releases/tag/v2.0.0) of __@ui5/webcomponents__. */ declare const FormItem: import("react").ForwardRefExoticComponent<FormItemPropTypes & import("@ui5/webcomponents-react-base").WithWebComponentPropTypes & import("react").RefAttributes<FormItemDomRef>>; export { FormItem }; export type { FormItemDomRef, FormItemPropTypes };