Skip to content

Layouts #90

Open
Open
@ZeroIntensity

Description

@ZeroIntensity

Feature description

On top of the current component API, a layout system should be implemented. This will be waiting on #12, #83, and #44.

Feature example API

from view import layout, page, h1, new_app

app = new_app()

@app.layout  # or @layout, which will be handled by the loader
async def lay(content: DOMNode | str):
    return page(content)

@app.get("/")
async def index():
    return h1("Hello, view.py!")

# OR

@index.layout
async def lay(content: DOMNode | str):
    return page(content)

app.run()

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiThis has to do with the Python API (view)improvementImprovement to an existing feature

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions