react-aria radio inline styling #6053
-
Hi all, I'm trying to create a reusable wrapper with react-aria's Radio Group, but have stumbled into a snag when trying to style things.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Can you say more about why you need the native input to be visible? It'd just look like a native one. We use a before pseudo element in this example https://react-spectrum.adobe.com/react-aria/RadioGroup.html#example but you could add whatever elements you want as children in order to style your radio. You could make it a circle like we do, or you could make a star or a card, anything you like. There are some more examples a little further down as well, see https://react-spectrum.adobe.com/react-aria/RadioGroup.html#examples |
Beta Was this translation helpful? Give feedback.
-
I figured that I should use the existing span that was there since my intention is to add a span anyway - is there any way to remove that default invisible span so that I don't have two as children of the label? |
Beta Was this translation helpful? Give feedback.
Can you say more about why you need the native input to be visible? It'd just look like a native one.
We use a before pseudo element in this example https://react-spectrum.adobe.com/react-aria/RadioGroup.html#example but you could add whatever elements you want as children in order to style your radio. You could make it a circle like we do, or you could make a star or a card, anything you like. There are some more examples a little further down as well, see https://react-spectrum.adobe.com/react-aria/RadioGroup.html#examples