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
Accordion #2310
Merged
Merged
Accordion #2310
Conversation
This file contains 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
Contributor
Alek99
commented
Dec 19, 2023
•
edited by ElijahAhianyo
edited by ElijahAhianyo
My root renders as so <RadixAccordionRoot collapsible={true} color={`accent`} css={{...{"width": "300px"}, ...(() => { switch (JSON.stringify(state__state.variant)) {case JSON.stringify(`classic`): return ({"border_radius": "6px", "background_color": isTrue(false) ? `var(--accent-9)` : `var(--slate-9)`, "box_shadow": "0 2px 10px var(--black-a4)"}); break;case JSON.stringify(`soft`): return ({"border_radius": "6px", "background_color": isTrue(false) ? `var(--accent-3)` : `var(--slate-3)`, "box_shadow": "0 2px 10px var(--black-a1)"}); break;default: return ({}); break;};})()}} variant={state__state.variant}> |
Problem thus far conds inside match doesn't work and match doesn't seem to work as a style prop |
ElijahAhianyo
force-pushed
the
alek/accord
branch
from
January 11, 2024 13:22
4f51dfe
to
8f22015
Compare
Code doesn't seem to work for me can you provide example for code that you used to test """Welcome to Reflex! This file outlines the steps to create a basic app."""
from rxconfig import config
import reflex as rx
import reflex.components.radix.themes as rdxt
import reflex.components.radix.primitives as rdxp
class State(rx.State):
"""The app state."""
value: str = 'a'
variant = 'classic'
items: list[tuple[str, str]] = [
("Is it accessible?", "Yes. It's built with accessibility in mind."),
("Is it unstyled?", "Yes. It's unstyled by default, giving you freedom over the look and feel."),
("Is it finished?", "It's still in beta, but it's ready to use in production."),
]
items = [
rdxp.accordion_item("Is it accessible?", rdxt.button("Test button"), disabled=True, font_size="3em"),
rdxp.accordion_item("Is it unstyled?", "Yes. It's unstyled by default, giving you freedom over the look and feel."),
rdxp.accordion_item("Is it finished?", "It's still in beta, but it's ready to use in production."),
]
def accordion_row(variant: str) -> rx.Component:
return rdxt.flex(
rdxp.accordion(
*items,
collapsible=True,
width="300px",
variant=variant,
color_scheme="primary"
),
rdxp.accordion(
*items,
collapsible=True,
width="300px",
variant=variant,
color_scheme="accent"
),
direction="row",
padding_x="2em",
gap="1",
)
def index() -> rx.Component:
return rdxt.theme(
rdxt.container(
rx.cond(
State.value,
rx.text('first value'),
rx.text("fourth value"),
),
rdxt.flex(
accordion_row(variant=State.variant),
direction="column",
gap="2"
),
padding="2em",
font_size="2em",
text_align="center",
background = "var(--accent-2)",
height="100vh",
)
)
# Add state and page to the app.
app = rx.App(
theme=rdxt.theme(
appearance="dark", has_background=True, radius="none", accent_color="grass"
),
)
app.add_page(index) |
This exact code works for me when I test it locally. |
My bad problem with my environment, resolved |
This reverts commit f4e9fe5.
ElijahAhianyo
force-pushed
the
alek/accord
branch
from
January 17, 2024 23:02
104a712
to
dd56b05
Compare
picklelo
approved these changes
Jan 18, 2024
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.