Skip to main content

Jinja2 macro components and Pico CSS theming for the Bluefox Stack.

Project description

bluefox-components

Jinja2 macro components and Pico CSS theming for the Bluefox Stack.

What it is

A PyPI package that provides:

  • Jinja2 macro templates — parameterized, composable UI building blocks under the bfx/ namespace
  • A CSS theme layer — Pico CSS variable overrides for the Bluefox default palette, plus 4 alternate theme variants
  • A component showcase — mountable FastAPI router for a storybook-like preview of every component
  • A setup function — registers templates and static assets with one call

Quick start

uv add bluefox-components
from bluefox_core import BluefoxSettings, create_bluefox_app
from bluefox_components import setup_components

settings = BluefoxSettings()
app = create_bluefox_app(settings)
setup_components(app)
{% extends "bfx/base.html" %}
{% from "bfx/button.html" import button %}
{% from "bfx/input.html" import input %}

{% block content %}
<form method="post">
  {{ input("email", type="email", label="Email") }}
  {{ button("Sign in") }}
</form>
{% endblock %}

Components

Category Macros
Forms button, input, select, textarea, form_group, csrf_input
Layout card, nav, breadcrumbs
Data data_table, pagination, empty_state
Feedback alert, badge, modal, modal_trigger, loading_spinner, loading_skeleton

Every macro accepts an attrs parameter (dict) for arbitrary HTML attributes — HTMX, Alpine.js, data-*, aria-* all pass through without the macro needing to know about them.

Themes

4 theme variants, each with distinct typography, border radii, and visual identity:

Theme Font Feel
Financial Inter + DM Serif Display Corporate, conservative, tight corners
Playful Nunito Bouncy, pill buttons, purple accent
Minimal IBM Plex Sans Monochrome, zero radius, dense
Roommate Outfit + DM Serif Display Warm terracotta, soft rounded

Apply a theme with a single attribute on <html>:

<html data-bfx-theme="financial">

Or pass it from your template:

{% extends "bfx/base.html" %}
{# renders: <html data-bfx-theme="financial"> #}
templates.get_template("page.html").render(theme="financial")

Component showcase

Mount the built-in showcase router for live documentation:

from bluefox_components import component_router

app.include_router(component_router, prefix="/components")

Design decisions

  • Macros, not includes. Explicit parameters for the 90% case, attrs dict for escape hatches.
  • Pure Pico CSS. No Tailwind, no utility classes. Themes override CSS custom properties only.
  • Zero build step. No bundler, no compilation. Install, call setup_components(), use macros.
  • Semantic HTML. A card is an <article>, a form group is a <label>, a nav is a <nav>. Pico styles them automatically.

Requirements

License

MIT

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

bluefox_components-0.9.0.tar.gz (106.9 kB view details)

Uploaded Source

Built Distribution

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

bluefox_components-0.9.0-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

Details for the file bluefox_components-0.9.0.tar.gz.

File metadata

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

File hashes

Hashes for bluefox_components-0.9.0.tar.gz
Algorithm Hash digest
SHA256 5311b62edceb5c5a098219ffc3d29860fe94db7581aa175c1f5c1f0631e07639
MD5 c406ff6e3c54f177f0b904cb8c137cd1
BLAKE2b-256 80e1f2b7c2f1db36392b26b55a1980e2aac6a03ddbf4cfaf6d97112bc9a19e4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for bluefox_components-0.9.0.tar.gz:

Publisher: publish.yml on blue-fox-software/bluefox-components

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

File details

Details for the file bluefox_components-0.9.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bluefox_components-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 746c9fa9c50ce04e7aa98cd5dfd8d19560f3eaa6053ca64689dd4f1b347dce36
MD5 682950884d04cf0810c389ffaf24e561
BLAKE2b-256 c2e3ec602154ffe28f5154b2cab656af33478fc20d562c23858836a14965ebfc

See more details on using hashes here.

Provenance

The following attestation bundles were made for bluefox_components-0.9.0-py3-none-any.whl:

Publisher: publish.yml on blue-fox-software/bluefox-components

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