Skip to main content

Python-first UI component library for Datastar/StarHTML applications

Project description

StarHTML — Python Web Framework

StarUI — Python Component Library

PyPI version Python 3.12+

Python-first UI component library for StarHTML. shadcn/ui components with zero-configuration setup.

Documentation · StarHTML · Quick Start · Issues

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

starui-0.4.1.tar.gz (29.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

starui-0.4.1-py3-none-any.whl (39.3 kB view details)

Uploaded Python 3

File details

Details for the file starui-0.4.1.tar.gz.

File metadata

  • Download URL: starui-0.4.1.tar.gz
  • Upload date:
  • Size: 29.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for starui-0.4.1.tar.gz
Algorithm Hash digest
SHA256 bf00af8c4cf80abfc9e018f14976912943df14c303f00c17a89a84927fabc5bf
MD5 064ebb6a89b16811ae197e1c9313fe65
BLAKE2b-256 55b6e8c8dd4ffe814c72fe2e2f76ac6a97da2826e7b3bfa3fd34d9e7dfd2bda2

See more details on using hashes here.

Provenance

The following attestation bundles were made for starui-0.4.1.tar.gz:

Publisher: release.yml on banditburai/starUI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file starui-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: starui-0.4.1-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

Hashes for starui-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1dbb3973ccf45f4c3549faf78ee7b021e6b7eb685d5f137d931c69fb28e89b21
MD5 dd54be9b27533a52f67099eea2d392f9
BLAKE2b-256 33aa619db8ddf4fe54da8e5b1ef0bd581f601a808caebb1ff5af0a86f5fb8e11

See more details on using hashes here.

Provenance

The following attestation bundles were made for starui-0.4.1-py3-none-any.whl:

Publisher: release.yml on banditburai/starUI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page