@itwin/itwinui-react
Version:
A react component library for iTwinUI
30 lines (29 loc) • 979 B
TypeScript
import type { PolymorphicForwardRefComponent } from '../../utils/index.js';
type LabelOwnProps = {
/**
* Set the display style of the label.
* - 'block' - default, no extra spacing (label and input will be on separate lines)
* - 'inline' - label gets a right margin so it can be placed inline
* @default 'block'
*/
displayStyle?: 'block' | 'inline';
/**
* Set to true if the label's associated input is required.
* This adds an asterisk next to the label text.
*/
required?: boolean;
/**
* Adds disabled styling to a label.
* @default false
*/
disabled?: boolean;
};
/**
* A standalone label to be used with input components (using `htmlFor`).
* Can be rendered as any element, e.g. span, using the `as` prop.
* @example
* <Label htmlFor='name-input'>Name</Label>
* <Input id='name-input' />
*/
export declare const Label: PolymorphicForwardRefComponent<"label", LabelOwnProps>;
export {};