HTML Elements
Low-level HTML element wrappers. These map directly to standard HTML tags with Python-friendly attribute naming (cls → class, hx_get → hx-get).
Button
Standard HTML <button> element.
Preview
Code
Parameters
| Parameter | Type | Description |
|---|---|---|
*children |
Any |
Button content |
type |
str |
Button type (button/submit/reset) |
Input
HTML <input> element. Void element (no children).
Preview
Code
Parameters
| Parameter | Type | Description |
|---|---|---|
type |
str |
Input type (text/email/password/number/...) |
name |
str |
Field name |
placeholder |
str |
Placeholder text |
Select / Option
HTML <select> with <option> children.
Preview
Code
Select(
Option("Apple", value="apple"),
Option("Banana", value="banana"),
Option("Cherry", value="cherry"),
name="fruit",
)
Parameters
| Parameter | Type | Description |
|---|---|---|
name |
str |
Field name |
*children |
Option |
Option elements |
Table
HTML <table> with thead/tbody structure.
Preview
Code
Table(
Thead(Tr(Th("Name"), Th("Age"))),
Tbody(
Tr(Td("Alice"), Td("30")),
Tr(Td("Bob"), Td("25")),
),
)
Form
HTML <form> container.
Preview
Code
Form(
Label("Name", Input(type="text", name="name")),
Button("Submit", type="submit"),
method="post",
)
Ul / Ol
Unordered and ordered list elements.
Preview
Code
Div(
H3("Unordered"),
Ul(Li("Item 1"), Li("Item 2"), Li("Item 3")),
H3("Ordered"),
Ol(Li("First"), Li("Second"), Li("Third")),
)
Details / Summary
Disclosure widget with expandable content.
Preview
Code
Progress
HTML <progress> bar.
Preview
Code
Video
HTML <video> element.
Preview
Code
Img
HTML <img> element.