Native form validation for the checkbox component with a hidden checkbox #444
Labels
enhancement
An improvement to an existing feature/component
Svelte 5 Roadmap
This issue is planned to be addressed or fixed when the library migrates to Svelte 5.
Describe the feature in detail (code, mocks, or screenshots encouraged)
Currently the checkbox component is implemented as a button element. This setup doesn't trigger native form validation on submit when the checkbox is required but not checked, as it lacks a real input type="checkbox". Could you consider adding a hidden native checkbox within the custom component? Implementing this would not only ensure compatibility with standard HTML form validation but also enhance accessibility and user experience by leveraging the browser's built-in validation.
What type of pull request would this be?
None
Provide relevant links or additional information.
I am currently adding the following right above the Checkboxprimitive.Root to make it work:
The text was updated successfully, but these errors were encountered: