Skip to content
Discussion options

You must be logged in to vote

@QGoos try something like this

import pynecone as pc


class State(pc.State):
    """The app state."""
    x: list[int] = [0, 1, 2]
    y: list[int] = [0, 1, 2]


def index() -> pc.Component:
    return pc.vstack(
        pc.foreach(
            State.x,
            lambda x: pc.hstack(
                pc.foreach(
                    State.y,
                    lambda y: pc.text(x, y),
                ),
            ),
        )
    )


# Add state and page to the app.
app = pc.App(state=State)
app.add_page(index)
app.compile()

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by QGoos
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