feat(RadioList): render custom content as the radio [TEM-479]#2809
Closed
mikeyrayvon wants to merge 3 commits into
Closed
feat(RadioList): render custom content as the radio [TEM-479]#2809mikeyrayvon wants to merge 3 commits into
mikeyrayvon wants to merge 3 commits into
Conversation
RadioButton now renders its children in place of the default dot indicator and honours asChild, so a consumer element becomes the radio itself while keeping the radio role, checked state, roving tab order, and arrow-key navigation from the underlying primitive. Enables patterns like large selectable cards. Existing usages without children/asChild are unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 6df2af8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for fondue-components ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Runs useId inside a named React component instead of the story's render callback, resolving the rules-of-hooks finding on the new story. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
syeo66
approved these changes
Jul 23, 2026
Contributor
|
I'm not sure if this is something that really needs to be in fondue. @mikeyrayvon do you know if the designers had an alignemnt on this? |
noahwaldner
requested changes
Jul 23, 2026
| @@ -0,0 +1,33 @@ | |||
| /* (c) Copyright Frontify Ltd., all rights reserved. */ | |||
|
|
|||
| .card { | |||
Contributor
There was a problem hiding this comment.
for story examples we use tailwind
Contributor
|
I had a call with @mikeyrayvon and we will pause this until johanna is back to discuss the addition of a "card" variant, to avoid accepting custom components |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📖 Background
Templates has two new cases where a
radiogroupis the appropriate role for a custom form element. Instead of building a bespoke component behaving as an accessible radio group, we would like to benefit from the FondueRadioList, but use our own custom card component as theRadioButton.Today
RadioButtonhardcodes the<Indicator>dot as its only child, soasChildmerges onto the dot rather than a card.🎯 What does this PR do?
Lets a
RadioList.RadioButtonrender your own element as the radio instead of the built-in dot. Passchildrento replace the dot indicator, orasChildto make a consumer element (e.g. a large selectable card) be the radio — it still gets the radio role, checked state, roving tab order, and arrow-key navigation from the primitive. Existing radios (nochildren/asChild) are unchanged.🧪 How to test
data-state="checked"attribute the primitive sets (shown in the story).🖼️ Screenshots
Storybook:
Use cases:
📌 Related tickets & additional notes
asChildmode the defaultstyles.itemdot styling is intentionally skipped so it doesn't fight the consumer's element; the consumer owns styling (and focus visuals) viadata-state. Backwards-compatible — the change is purely additive.