# Subcomponents

{% hint style="danger" %}
Notice that there is a difference between using `hasError, isDisabled` here or in the parent component. It is not recommended to change this props in the `Control` or in the`Label`subcomponent, because this props can be inherited from the `Wrapper`. If you use it in the `Control` subcomponent, you will get the state only in the field.&#x20;
{% endhint %}

### Control

The control subcomponent is required to render the `Control` of the TextInput component. Because of this, this component extends the native [`input[type="radio"]`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio) component props.  Because of this, you can use all of the native props. This is a required children.

### Control API

| Props            | Type                                | Required |
| ---------------- | ----------------------------------- | -------- |
| `defaultChecked` | `boolean`                           | ❌        |
| `checked`        | `boolean`                           | ❌        |
| `hasError`       | `boolean`                           | ❌        |
| `isDisabled`     | `boolean`                           | ❌        |
| `onChange`       | `(e: React.ChangeEvent) => void; }` | ❌        |

<details>

<summary>defaultChecked</summary>

Defines the initial check state for the uncontrolled version of the component

</details>

<details>

<summary>checked</summary>

Defines the check state for the controlled version of the component

</details>

<details>

<summary>onChange</summary>

The function executed passed when the radio state changes.

</details>

### Label

{% hint style="danger" %}
The label subcomponent **does not** extend the SDS label component. &#x20;
{% endhint %}

### Label API

This subcomponent extends the native label props.

| Props        | Type        | Required |
| ------------ | ----------- | -------- |
| `children`   | `ReactNode` | ❌        |
| `isDisabled` | `boolean`   | ❌        |
| `hasError`   | `boolean`   | ❌        |

<details>

<summary>children</summary>

The rendered string or structure passed to the label.

</details>
