checkbox: Add unstable Provider
, Trigger
and BubbleInput
#3459
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces new parts for the Checkbox component. This change is intended to test out a new pattern that we can replicate for other form controls.
Currently our form control components will try to detect whether or not they are associated with a form, and if so, render a hidden input so that native events bubble to the form itself. While this can make behavior feel more like native form elements, the downside is that it adds an additional element that is hard to control and not always what users expect.
The goal is the hand control back to the user. So instead of
Checkbox.Root
rendering both a provider and an input, users can opt in and render the parts that they want.Currently these parts are prefixed with
unstable_
since we may want to consider the API more deeply before committing to these patterns. Should we decide to move forward, in a future version we'd probably renameCheckbox.Provider
toCheckbox.Root
and get rid of the pre-composed version entirely.Related:
BubbleInput
/BubbleSelect
#3365