New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
radiogroup high level api #2401
Conversation
Flex.create( | ||
RadioGroupItem.create(value=value), | ||
value, | ||
gap="2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this also use the passed gap
for consistency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the gap=2
is the distance between the radio group and the text it is associated with. The gap that we allow the user to pass is the distance between the different radio group items. I therefore do not think they should be passed the same value, and think we should keep the value between the radio group and the text fixed.
Must import as shown"
from reflex.components.radix.themes.components import *
Most basic usage, pass in a list of strings :
radio_group(["1", "2", "3", "4", "5"])
Can set several props such as
direction
,gap
:radio_group(["1", "2", "3", "4", "5"], direction="row", gap="6"))
and any other prop that the
RadioGroupRoot
component takes:radio_group(["1", "2", "3", "4", "5"], direction="row", gap="6", variant="soft", size="3", color_scheme="red", default_value="3")
The list of strings passed can also be a state var and this will still work