UNPKG

@base-ui/react

Version:

Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.

25 lines 1.24 kB
import * as React from 'react'; import { FieldRoot } from "../root/FieldRoot.js"; import type { BaseUIComponentProps } from "../../utils/types.js"; /** * An accessible label that is automatically associated with the field control. * Renders a `<label>` element. * * Documentation: [Base UI Field](https://base-ui.com/react/components/field) */ export declare const FieldLabel: React.ForwardRefExoticComponent<Omit<FieldLabelProps, "ref"> & React.RefAttributes<HTMLElement>>; export type FieldLabelState = FieldRoot.State; export interface FieldLabelProps extends BaseUIComponentProps<'label', FieldLabel.State> { /** * Whether the component renders a native `<label>` element when replacing it via the `render` prop. * Set to `false` if the rendered element is not a label (e.g. `<div>`). * * This is useful to avoid inheriting label behaviors on `<button>` controls (such as `<Select.Trigger>` and `<Combobox.Trigger>`), including avoiding `:hover` on the button when hovering the label, and preventing clicks on the label from firing on the button. * @default true */ nativeLabel?: boolean | undefined; } export declare namespace FieldLabel { type State = FieldLabelState; type Props = FieldLabelProps; }