Form

Formは、複数のフォーム要素をグループ化するためのコンポーネントです。

Create an account

Create an account to get started.

If not set, a password will be automatically generated.

使い方

import { Form } from "@yamada-ui/react"
<Form.Root>
  <Form.Header>
    <Form.Title />
    <Form.Description />
  </Form.Header>
  <Form.Body>
    <Form.Group />
  </Form.Body>
  <Form.Footer>
    <Form.SubmitButton />
  </Form.Footer>
</Form.Root>

propsを使う

Create an account

Create an account to get started.

If not set, a password will be automatically generated.

バリアントを変更する

Create an account

Create an account to get started.

Personal information
If not set, a password will be automatically generated.

Create an account

Create an account to get started.

Personal information
If not set, a password will be automatically generated.

Create an account

Create an account to get started.

Personal information
If not set, a password will be automatically generated.

Create an account

Create an account to get started.

Personal information
If not set, a password will be automatically generated.

サイズを変更する

Create an account

Create an account to get started.

Personal information
If not set, a password will be automatically generated.

Create an account

Create an account to get started.

Personal information
If not set, a password will be automatically generated.

Create an account

Create an account to get started.

Personal information
If not set, a password will be automatically generated.

ヘルプメッセージを表示する

ヘルプメッセージを表示する場合は、helperMessage{[key: string]: ReactNode}を設定します。

Create an account

Create an account to get started.

If not set, a password will be automatically generated.

エラーメッセージを表示する

エラーメッセージを表示する場合は、errorMessage{[key: string]: ReactNode}を設定します。

Create an account

Create an account to get started.

If not set, a password will be automatically generated.

必須にする

必須にする場合は、required{[key: string]: boolean}を設定します。

Create an account

Create an account to get started.

If not set, a password will be automatically generated.

無効にする

無効にする場合は、disabled{[key: string]: boolean}を設定します。

Create an account

Create an account to get started.

If not set, a password will be automatically generated.

読み取り専用にする

読み取り専用にする場合は、readOnly{[key: string]: boolean}を設定します。

Create an account

Create an account to get started.

If not set, a password will be automatically generated.

必須インジケーターをカスタマイズする

必須インジケーターをカスタマイズする場合は、requiredIndicatorReactNodeを設定します。

Create an account

Create an account to get started.

If not set, a password will be automatically generated.

オプショナルインジケーターを使う

オプショナルインジケーターを使う場合は、optionalIndicatorReactNodeを設定します。

Create an account

Create an account to get started.

If not set, a password will be automatically generated.

アクセシビリティ

ARIAロールと属性

コンポーネントロールと属性使い方
Form.RootidForm.SubmitButtonと関連付けるために使用するid
aria-labelledby関連したForm.TitleForm.Descriptionidを設定します。
Form.TitleidForm.RootForm.Descriptionと関連付けるために使用するid
Form.DescriptionidForm.Rootと関連付けるために使用するid
aria-describedby関連したForm.Titleidを設定します。
Form.SubmitButtonform関連したForm.Rootidを設定します。

Props

類似のコンポーネント

Field

Fieldは、フォーム要素に、ラベル、ヘルパーメッセージ、エラーメッセージなどをグループ化するために使用されるコンポーネントです。

Fieldset

Fieldsetは、フィールドセット要素に、レジェンド、ヘルパーメッセージ、エラーメッセージなどをグループ化するために使用されるコンポーネントです。

Bleed

Bleedは、要素をコンテナの境界から外すために使用されるコンポーネントです。

Box

Boxは、他のすべてのコンポーネントがその上に構築される最も抽象的なコンポーネントです。デフォルトでは、div要素をレンダリングします。

Center

Centerは、コンポーネント内の子要素を中央に配置するコンポーネントです。

Container

Containerは、汎用的な区分要素として使用するコンポーネントです。デフォルトでは、section要素をレンダリングします。

Flex

Flexは、Boxflexを設定したコンポーネントです。また、便利なスタイルのショートハンドが用意されています。

Float

Floatは、要素をコンテナの端に固定するために使用されるコンポーネントです。

使用しているコンポーネント・フック

使用されているコンポーネント・フック