# Form

## Overview

Forms are used for submitting data so be as concise as possible when designing. Keep it short. Think about each field and what value the data will provide. What do you gain by collecting this information?

<figure><img src="https://2985180403-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhSQqKqKx7I7rVBbqF_%2Fuploads%2Frrydncnt2TtRdFhLwse3%2Fform.png?alt=media&#x26;token=b9baa44f-d6e1-4ad1-a5fb-3feeca090aa8" alt=""><figcaption></figcaption></figure>

### Widget API

| Property | Description                                                                                                                                                                                     |
| -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| children | <p>The content of the form.</p><ul><li><strong>Type:</strong> <code>List\<Widget></code></li><li><strong>Default:</strong> required</li></ul>                                                   |
| enable   | <p>Whether the form is enabled or not.</p><ul><li><strong>Type:</strong> <code>bool</code></li><li><strong>Default:</strong> <code>true</code></li></ul>                                        |
| type     | <p>The type of the form. It can be <code>group, blank</code>.</p><ul><li><strong>Type:</strong> <code>CFormType</code></li><li><strong>Default:</strong> <code>CFormType.blank</code></li></ul> |
| action   | <p>An action widget to display at the end of the form.</p><ul><li><strong>Type:</strong> <code>Widget?</code></li><li><strong>Default:</strong> optional</li></ul>                              |

### Example

<pre class="language-dart"><code class="lang-dart">CForm(
  type: CFormType.blank,
  action: CButton(
    label: 'Action Button',
    onTap: () {},
    icon: Icon(CIcons.add, size: 16),
    ),
    children: [
      CTextField(label: 'Label', description: 'Description'),
      const SizedBox(height: 16),
      CTextField(
        label: 'Label',
        description: 'Description',
        validator: (value) {
          return CValidationResult(
            kind: CValidationKind.error,
            message: 'Your input is incorrect',
          );
<strong>        },
</strong>      ),
    ],
);
</code></pre>
