Skip to content

Better form developer experience #269

@ogix

Description

@ogix

Feature request type

Enhance forms

Component name

No response

What should be done?

This is very nice UI framework but it lacks good developer experience for forms.

For example, currently form components like Textbox or Select are responsible for displaying labels, their position and error messages. This design introduces these limitations:

  • Each form component needs to have same repetitve properties as Label, LabelPlacement, ErrorMessage, Description, etc
  • It's harder to create new custom form components. This is very important as any framework should allow to create custom form components with same styling.
  • Since components accept ErrorMessage property, form validation with DataAnnotationsValidator becomes as not a trivial task.
  • Probably harder to ensure consistent field styling for all components

Instead I suggest to have some kind of reusable FormField wrapper component that would be responsible for displaying labels, description as other frameworks do. Regarding validation errors, it could have a placeholder to use either Blazor's ValidationMessage component or any custom message.

If it had better form DX and more form controls (DatePicker, TextArea), it would be my number 1 choice for new Blazor projects!

Pull Request

  • I would like to do a Pull Request

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions