Repository navigation
fasthtml-basecoatui — Basecoat components for FastHTML #943
SpaceShaman
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone! I’d like to share fasthtml-basecoatui, a small library for using Basecoat components in FastHTML.
It provides typed Python components with bundled CSS and JavaScript, and integrates with fasthtml-tailwindcss for CSS builds and watch mode.
Installation
Using uv:
uv add fasthtml-basecoatui "fasthtml-tailwindcss[dev]"Or pip:
pip install fasthtml-basecoatui "fasthtml-tailwindcss[dev]"The Tailwind compiler is only needed for development and CSS builds.
Usage
Run with:
CSS is written to
static/tailwind.cssand served through a versioned stylesheet link. Watch mode rebuilds it as your classes change, and the compiler stays alive across server reloads. No Node.js, npm, or CDN is needed.Components and styles
Use components such as
Card,Button,Input,Dialog, andTabsalongside native FastHTML elements, following Basecoat’s documented HTML structure.Variants and sizes are typed for editor autocomplete and type checking:
Eight Basecoat styles are included. Choose one with
BasecoatInput("nova").BasecoatJS()also restores the saved theme or follows the system preference.The repository includes 12 standalone examples, covering forms, cards, tabs, dialogs, tables, HTMX notifications, and more. Chart support is planned for a future release.
Production
Use the default
watch=Falseand build CSS before deployment:Deploy the generated stylesheet with your application. The Tailwind compiler does not need to be installed in production.
Automatic updates
A daily workflow checks npm for new
basecoat-cssreleases, regenerates the components, bundles the assets, and builds, tests, and publishes the package.The PyPI version follows the bundled Basecoat version. Python-only fixes use a
.postNsuffix.Links
Feedback and suggestions are welcome!
All reactions