HTML helpers
wybthon.html¶
html
¶
Pythonic HTML element helpers that wrap h().
These helpers let you author markup that reads more like Python than hyperscript. Instead of writing:
you can write:
Children are positional arguments and props are keyword arguments.
Prop name mapping (Python keyword to HTML attribute):
class_→class(the canonical reserved-word workaround).html_for→for(Python reserved word).- All other kwargs pass through unchanged.
Each helper exported here (e.g. div, p, button, input_) is a
thin wrapper that returns a VNode. Two element
names collide with Python builtins, so they are exposed with a trailing
underscore: main_ and input_.
See Also
Functions:
| Name | Description |
|---|---|
Fragment |
Group multiple children without adding an extra DOM wrapper element. |
Fragment
¶
Group multiple children without adding an extra DOM wrapper element.
Fragments use empty comment nodes as start/end markers and mount their
children directly into the parent container. This avoids extra
elements that would pollute selectors like :first-child or affect
layout.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
Any
|
Either a sequence of children ( |
()
|
Returns:
| Type | Description |
|---|---|
VNode
|
A |