Core Components
Framework-agnostic HTML primitives — no UI kit required.
| Component | Tag | Module |
|---|---|---|
| ButtonComponent | button | trunco.components.button |
| InputComponent | input | trunco.components.input |
| FormComponent | form | trunco.components.form |
| SelectComponent | select | trunco.components.select |
Base component
python
from trunco import Component
card = Component(tag="div")
card.add_class("card")
card.add_child("Hello")StyleSheet
Build a project style.css in Python with variables, rules, @media blocks, and helpers to write the file or embed it in a page.
python
from trunco.components import StyleSheet
sheet = StyleSheet()
sheet.variables(primary="#3b82f6", body_bg="#ffffff")
sheet.rule("body", font_family="Inter, sans-serif", margin=0)
sheet.rule(".card", border_radius=12, padding=16)
sheet.write("assets/style.css")
page.add_child(sheet.to_link("assets/style.css"))