Features
Higher-level feature components for authentication, theming, charting, and code display.
LoginForm
Pre-built login form with username/password fields.
Preview
Code
Parameters
| Parameter | Type | Description |
|---|---|---|
action |
str |
Form action (default: "/login") |
title |
str |
Form title (default: "Login") |
use_email |
bool |
Use email field instead of username |
register_url |
str | None |
Link to register page |
forgot_url |
str | None |
Link to forgot password page |
RegisterForm
Pre-built registration form.
Preview
Code
Parameters
| Parameter | Type | Description |
|---|---|---|
action |
str |
Form action (default: "/register") |
title |
str |
Form title (default: "Register") |
login_url |
str | None |
Link to login page |
DarkModeToggle
Toggle button for light/dark theme switching.
Preview
Code
Parameters
| Parameter | Type | Description |
|---|---|---|
light_theme |
str |
Light theme name (default: "light") |
dark_theme |
str |
Dark theme name (default: "dark") |
key |
str |
localStorage key |
ThemeSwitcher
Dropdown for switching between multiple DaisyUI themes.
Preview
Code
Parameters
| Parameter | Type | Description |
|---|---|---|
themes |
list[str] |
Available theme names |
default |
str |
Default theme (default: "light") |
Chart
Chart.js wrapper for line, bar, pie, and other charts.
Preview
Code
Chart(
type="bar",
data={
"labels": ["Jan", "Feb", "Mar", "Apr"],
"datasets": [{
"label": "Sales",
"data": [12, 19, 3, 5],
}],
},
height="300px",
)
Parameters
| Parameter | Type | Description |
|---|---|---|
type |
str |
"line" |
data |
dict |
Chart.js data object |
options |
dict | None |
Chart.js options |
width |
str |
CSS width (default: "100%") |
height |
str |
CSS height (default: "400px") |
CodeBlock
Syntax-highlighted code display (requires Highlight.js).
Preview
Code
Parameters
| Parameter | Type | Description |
|---|---|---|
code |
str |
Source code to display |
language |
str | None |
Language for syntax highlighting |
copy_button |
bool |
Show copy button |