Skip to content

feat: Export building-block components for Field #25500

@behowell

Description

@behowell

Need to export the individual pieces of a field as separate components, like <FieldLayout>, <FieldLabel> and <FieldMessage>. The user would be responsible for hooking up props between them (like htmlFor and aria-labelledby), but it would allow a Fluent v9 field to be constructed from its parts. Something like this: (very much TBD exactly how it would work)

<FieldLayout>
  <FieldLabel htmlFor="my-input">Example label</FieldLabel>
  <MyInput id="my-input" aria-invalid="true" aria-errormessage="my-error-message" aria-describedby="my-hint" />
  <FieldMessage id="my-error-message" validationState="error">Example error message</FieldMessage>
  <FieldMessage id="my-hint">Example hint text</FieldMessage>
</FieldLayout>

Original discussion: #25463

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions