Title: BaseControl
Published: March 9, 2021
Last modified: October 15, 2026

---

# BaseControl

## In this article

 * [Props](https://developer.wordpress.org/block-editor/reference-guides/components/base-control/?output_format=md#props)
    - [className](https://developer.wordpress.org/block-editor/reference-guides/components/base-control/?output_format=md#classname)
    - [children](https://developer.wordpress.org/block-editor/reference-guides/components/base-control/?output_format=md#children)
    - [help](https://developer.wordpress.org/block-editor/reference-guides/components/base-control/?output_format=md#help)
    - [hideLabelFromVision](https://developer.wordpress.org/block-editor/reference-guides/components/base-control/?output_format=md#hidelabelfromvision)
    - [id](https://developer.wordpress.org/block-editor/reference-guides/components/base-control/?output_format=md#id)
    - [label](https://developer.wordpress.org/block-editor/reference-guides/components/base-control/?output_format=md#label)
 * [Subcomponents](https://developer.wordpress.org/block-editor/reference-guides/components/base-control/?output_format=md#subcomponents)
    - [BaseControl.VisualLabel](https://developer.wordpress.org/block-editor/reference-guides/components/base-control/?output_format=md#basecontrol-visuallabel)

See the [WordPress Storybook](https://wordpress.github.io/gutenberg/?path=/docs/components-basecontrol--docs)
for more detailed, interactive documentation.

`BaseControl` is a low-level component used to generate labels and help text for
components handling user inputs.

    ```language-jsx
    import { BaseControl, useBaseControlProps } from '@wordpress/components';

    // Render a `BaseControl` for a textarea input
    const MyCustomTextareaControl = ({ children, ...baseProps }) => (
        // `useBaseControlProps` is a convenience hook to get the props for the `BaseControl`
        // and the inner control itself. Namely, it takes care of generating a unique `id`,
        // properly associating it with the `label` and `help` elements.
        const { baseControlProps, controlProps } = useBaseControlProps( baseProps );

        return (
            <BaseControl { ...baseControlProps }>
                <textarea { ...controlProps }>
                  { children }
                </textarea>
            </BaseControl>
        );
    );
    ```

## 󠀁[Props](https://developer.wordpress.org/block-editor/reference-guides/components/base-control/?output_format=md#props)󠁿

### 󠀁[className](https://developer.wordpress.org/block-editor/reference-guides/components/base-control/?output_format=md#classname)󠁿

 * Type: `string`
 * Required: No

### 󠀁[children](https://developer.wordpress.org/block-editor/reference-guides/components/base-control/?output_format=md#children)󠁿

 * Type: `ReactNode`
 * Required: Yes

The content to be displayed within the `BaseControl`.

### 󠀁[help](https://developer.wordpress.org/block-editor/reference-guides/components/base-control/?output_format=md#help)󠁿

 * Type: `ReactNode`
 * Required: No

Additional description for the control.

Only use for meaningful description or instructions for the control. An element 
containing the description will be programmatically associated to the BaseControl
by the means of an `aria-describedby` attribute.

### 󠀁[hideLabelFromVision](https://developer.wordpress.org/block-editor/reference-guides/components/base-control/?output_format=md#hidelabelfromvision)󠁿

 * Type: `boolean`
 * Required: No
 * Default: `false`

If true, the label will only be visible to screen readers.

### 󠀁[id](https://developer.wordpress.org/block-editor/reference-guides/components/base-control/?output_format=md#id)󠁿

 * Type: `string`
 * Required: No

The HTML `id` of the control element (passed in as a child to `BaseControl`) to 
which labels and help text are being generated.
 This is necessary to accessibly
associate the label with that element.

The recommended way is to use the `useBaseControlProps` hook, which takes care of
generating a unique `id` for you.
 Otherwise, if you choose to pass an explicit `
id` to this prop, you are responsible for ensuring the uniqueness of the `id`.

### 󠀁[label](https://developer.wordpress.org/block-editor/reference-guides/components/base-control/?output_format=md#label)󠁿

 * Type: `ReactNode`
 * Required: No

If this property is added, a label will be generated using label property as the
content.

## 󠀁[Subcomponents](https://developer.wordpress.org/block-editor/reference-guides/components/base-control/?output_format=md#subcomponents)󠁿

### 󠀁[BaseControl.VisualLabel](https://developer.wordpress.org/block-editor/reference-guides/components/base-control/?output_format=md#basecontrol-visuallabel)󠁿

`BaseControl.VisualLabel` is used to render a purely visual label inside a `BaseControl`
component.

It should only be used in cases where the children being rendered inside `BaseControl`
are already accessibly labeled,
 e.g., a button, but we want an additional visual
label for that section equivalent to the labels `BaseControl` would otherwise use
if the `label` prop was passed.

    ```language-jsx
    import { BaseControl } from '@wordpress/components';

    const MyBaseControl = () => (
        <BaseControl help="This button is already accessibly labeled.">
            <BaseControl.VisualLabel>Author</BaseControl.VisualLabel>
            <Button>Select an author</Button>
        </BaseControl>
    );
    ```

#### 󠀁[Props](https://developer.wordpress.org/block-editor/reference-guides/components/base-control/?output_format=md#props-2)󠁿

##### 󠀁[as](https://developer.wordpress.org/block-editor/reference-guides/components/base-control/?output_format=md#as)󠁿

 * Type: `keyof IntrinsicElements | JSXElementConstructor<any>`
 * Required: No

The HTML element or React component to render the component as.

##### 󠀁[children](https://developer.wordpress.org/block-editor/reference-guides/components/base-control/?output_format=md#children-2)󠁿

 * Type: `ReactNode`
 * Required: Yes

The content to be displayed within the `BaseControl.VisualLabel`.

First published

March 9, 2021

Last updated

October 15, 2026

Edit article

[ Improve it on GitHub: BaseControl ](https://github.com/WordPress/gutenberg/edit/trunk/packages/components/src/base-control/README.md)

[  Previous: Autocomplete](https://developer.wordpress.org/block-editor/reference-guides/components/autocomplete/)

[  Next: BorderBoxControl](https://developer.wordpress.org/block-editor/reference-guides/components/border-box-control/)