Skip to content

How to set a RadioGroup item as checked by default? #741

Discussion options

You must be logged in to vote

Hello, @albertohermosillo

You don't need to touch any states/data-* attributes for this.

Just set the value prop on Root to that of your first item.

i.e.

<RadioGroup.Root
++ value="credit-card"
class="flex flex-row gap-2 py-3">

Cheers.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@albertohermosillo
Comment options

@shyakadavis
Comment options

@albertohermosillo
Comment options

@shyakadavis
Comment options

@albertohermosillo
Comment options

Answer selected by albertohermosillo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants