"""Welcome to Pynecone! This file outlines the steps to create a basic app.""" from pcconfig import config import pynecone as pc docs_url = "https://pynecone.io/docs/getting-started/introduction" filename = f"{config.app_name}/{config.app_name}.py" class State(pc.State): count: int = 0 def increment(self): self.count += 1 def decrement(self): self.count -= 1 def index(): return pc.hstack( pc.button( "Decrement", color_scheme="red", border_radius="1em", on_click=State.decrement, ), pc.heading(State.count, font_size="2em"), pc.button( "Increment", color_scheme="green", border_radius="1em", on_click=State.increment, ), ) def about(): return pc.text("About Page") def custom(): return pc.text("Custom Route") # Add state and page to the app. app = pc.App(state=State) app.add_page(index) app.add_page(about) app.add_page(custom, path="/custom-route") app.compile()