PyBlade/ui
Menu⌄
DocsInstallation

Installation

Set up PyBlade UI in an existing PyBlade project.

Requirements

Python 3.11 or newer, PyBlade 0.3 or newer and Tailwind CSS v4. Interactive components also need Alpine.js.

Initialize

pip install pyblade-ui
cd my-pyblade-project
pyblade-ui init --base zinc --color blue

init writes pyblade-ui.toml, generates static/css/theme.css, adds @import "./theme.css"; to static/css/tailwind.css, then installs theme-script and mode-toggle.

Hook up the framework

# Django: settings.py
INSTALLED_APPS = [..., "pyblade_ui"]

# Flask, FastAPI…: once, at startup
import pyblade_ui
templates/layout.html
<head>
  <pb-ui.theme-script />
  <link rel="stylesheet" href="@static('css/app.css')" />
  <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.14.9/dist/cdn.min.js"></script>
</head>

Adjust the path of the compiled stylesheet (@static) to your framework.

Add components

pyblade-ui add button card dialog
# or everything at once
pyblade-ui add --all

Dependencies come along: dialog also installs button. add never replaces a file you have changed, unless you pass --overwrite.