Python-first UI component library for Datastar/StarHTML applications
Project description
Python-first UI component library for StarHTML. shadcn/ui components with zero-configuration setup.
Quick Start
uv add starui
from starhtml import *
from components.ui.button import Button
from components.ui.card import Card, CardHeader, CardTitle, CardContent
app, rt = star_app()
@rt("/")
def home():
return Card(
CardHeader(
CardTitle("Welcome to StarUI")
),
CardContent(
Button("Get Started", variant="default"),
Button("Learn More", variant="outline")
)
)
serve()
Available Components
| Component | Description | Variants |
|---|---|---|
| Button | Interactive buttons | default, destructive, outline, secondary, ghost, link |
| Alert | Important messages | default, destructive |
| Badge | Status indicators | default, secondary, destructive, outline |
| Card | Content containers | Header, Content, Footer sections |
| Input | Form inputs | All HTML input types with validation |
| Label | Form labels | Accessible form labeling |
CLI
star init <project-name> # Create new project
star add <component> # Add component to project
star list # List available components
star dev <app.py> # Dev server with hot reload
star build # Build production CSS
Component API
Button
Button("Click me")
Button(
"Submit Form",
variant="default",
size="lg",
disabled=False,
type="submit",
onclick="handleSubmit()"
)
Card
Card(
CardHeader(
CardTitle("Product Card")
),
CardContent(
P("This is the card content with detailed information."),
Button("Learn More", variant="outline")
),
class_name="max-w-md"
)
Configuration
StarUI works with zero configuration, but you can customize it:
# starui.config.py (optional)
from starui.config import ProjectConfig
from pathlib import Path
config = ProjectConfig(
project_root=Path.cwd(),
css_output=Path("static/css/starui.css"),
component_dir=Path("components/ui")
)
Development
git clone https://github.com/banditburai/starui.git
cd starui
uv sync --all-extras
uv run ruff check && uv run pyright && uv run pytest tests/ -v
Contributions welcome — see CONTRIBUTING.md.
Acknowledgments
Built on shadcn/ui design patterns, StarHTML, and Tailwind CSS.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file starui-0.4.0.tar.gz.
File metadata
- Download URL: starui-0.4.0.tar.gz
- Upload date:
- Size: 29.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
affdbb7fec6239ad96c2c1dc8f49e088a3181e9e611eeb24617e2baabce72ae3
|
|
| MD5 |
9a23618594d7c42c23b33f77fa212f1f
|
|
| BLAKE2b-256 |
faa128b8fbf9e429e2db7b1edeedf300b7d866b0d849997fc5a721d8f2515bf9
|
Provenance
The following attestation bundles were made for starui-0.4.0.tar.gz:
Publisher:
release.yml on banditburai/starUI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
starui-0.4.0.tar.gz -
Subject digest:
affdbb7fec6239ad96c2c1dc8f49e088a3181e9e611eeb24617e2baabce72ae3 - Sigstore transparency entry: 1096825522
- Sigstore integration time:
-
Permalink:
banditburai/starUI@82b237ff886c19aa536f37ab4921d9082f0feefc -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/banditburai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@82b237ff886c19aa536f37ab4921d9082f0feefc -
Trigger Event:
push
-
Statement type:
File details
Details for the file starui-0.4.0-py3-none-any.whl.
File metadata
- Download URL: starui-0.4.0-py3-none-any.whl
- Upload date:
- Size: 39.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2271255537299f25e527dbb2083055afd9734c238bce46fe2c9db6d4affc42e
|
|
| MD5 |
962e64409efc3e64d077ba32043c3851
|
|
| BLAKE2b-256 |
f6817adee72141a0ceffa348f2b6d19121d00182b73fa229cd30d1ea6db5cc21
|
Provenance
The following attestation bundles were made for starui-0.4.0-py3-none-any.whl:
Publisher:
release.yml on banditburai/starUI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
starui-0.4.0-py3-none-any.whl -
Subject digest:
d2271255537299f25e527dbb2083055afd9734c238bce46fe2c9db6d4affc42e - Sigstore transparency entry: 1096825527
- Sigstore integration time:
-
Permalink:
banditburai/starUI@82b237ff886c19aa536f37ab4921d9082f0feefc -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/banditburai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@82b237ff886c19aa536f37ab4921d9082f0feefc -
Trigger Event:
push
-
Statement type: