/** * @license * Copyright (c) 2017 - 2026 Vaadin Ltd. * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ */ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js'; import { FormItemMixin } from './vaadin-form-item-mixin.js'; /** * `` is a Web Component providing labelled form item wrapper * for using inside ``. * * `` accepts a single child as the input content, * and also has a separate named `label` slot: * * ```html * * * * * ``` * * The label is optional and can be omitted: * * ```html * * Subscribe to our Newsletter * * ``` * * By default, the `label` slot content is displayed aside of the input content. * When `label-position="top"` is set, the `label` slot content is displayed on top: * * ```html * * * * * ``` * * **Note:** Normally, `` is used as a child of * a `` element. Setting `label-position` is unnecessary, * because the `label-position` attribute is triggered automatically by the parent * ``, depending on its width and responsive behavior. * * **Deprecation note:** The `label-position` attribute is deprecated and will be removed * in Vaadin 26. Use `labelsAside` property on the form-layout instead. * * ### Input Width * * By default, `` does not manipulate the width of the slotted * input element. Optionally you can stretch the child input element to fill * the available width for the input content by adding the `full-width` class: * * ```html * * * * * ``` * * ### Styling * * The `label-position` attribute can be used to target the label on top state: * * ```css * vaadin-form-item[label-position="top"] { * padding-top: 0.5rem; * } * ``` * * **Deprecation note:** The `label-position` attribute is deprecated and will be removed * in Vaadin 26. Use `labelsAside` property on the form-layout instead. * * The following shadow DOM parts are available for styling: * * Part name | Description * ---------------------|------------- * `label` | The slotted label element wrapper * `required-indicator` | The `required` state indicator element * * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation. */ declare class FormItem extends FormItemMixin(ThemableMixin(HTMLElement)) {} declare global { interface HTMLElementTagNameMap { 'vaadin-form-item': FormItem; } } export { FormItem };