Skip to main content

FastBlocks UI: HTML/CSS-first styling and component helpers for FastBlocks, successor to archived fastbulma

Project description

FastBlocks UI

Code style: crackerjack Runtime: oneiric uv Python: 3.13+

FastBlocks UI is a modern HTML/CSS-first UI layer with a stable ui-* namespace, Jinja/FastBlocks helpers, and optional enhancement JavaScript. It is the successor to the archived fastbulma project and is built as a clean-slate system with no compatibility bridge and no Sass/build-tool requirement.

Features

  • HTML/CSS First: Uses semantic markup, CSS variables, and cascade layers as the foundation
  • Template Helpers: Ships Python helpers for Jinja, async Jinja, and FastBlocks rendering
  • Optional Enhancement JS: Keeps behavior light and progressive-enhancement friendly
  • Modern Styling: Uses a Tailwind-inspired semantic token baseline with custom visuals
  • Permissive License: BSD-3-Clause for commercial and open-source use

Installation

Install using pip:

pip install fastblocks-ui

Then copy the assets to your project:

fastblocks-ui copy-assets --dest ./static

Usage

Once installed, you can use the ui-* classes and Python helpers with server-rendered HTML:

<div class="ui-card">
  <div class="ui-card__header">Card Title</div>
  <div class="ui-card__body">
    This is a FastBlocks UI card styled with semantic tokens.
  </div>
  <footer class="ui-card__footer">
    <button class="ui-button is-primary" type="button">Action</button>
  </footer>
</div>

For full examples covering sync Jinja, async Jinja, and htmx fragments, see docs/usage.md. The component manifest is documented in docs/components.md. PWA-friendly app integration notes live in docs/usage.md.

Template Examples

Sync Jinja

{{ button("Save changes", variant="primary", type="submit") }}

Async Jinja

template = env.get_template("profile.html")
html = await template.render_async(user=user, button=button)

htmx Fragment

<form id="profile-form" hx-post="/profile" hx-target="#profile-form" hx-swap="outerHTML">
  {{ field(
    label="Email address",
    control_html=ui_input(id="profile-email", name="email", type="email", value=user.email)
  ) }}
  {{ button("Save", variant="primary", type="submit") }}
</form>

Theming

FastBlocks UI enables flexible theming through CSS variables:

:root {
  --ui-color-primary: #e040fb;
  --ui-radius-md: 8px;
  --ui-color-success: #00c853;
}

FastBlocks UI components automatically inherit these changes through semantic token mapping.

Components

FastBlocks UI centers its public surface on ui-* classes and helper APIs:

  • ui-button
  • ui-card
  • ui-field
  • ui-input
  • ui-select
  • ui-checkbox
  • ui-switch
  • ui-dialog
  • ui-tabs
  • ui-menu
  • ui-alert

License

BSD-3-Clause

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

fastblocks_ui-0.4.1.tar.gz (21.9 kB view details)

Uploaded Source

Built Distribution

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

fastblocks_ui-0.4.1-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastblocks_ui-0.4.1.tar.gz
  • Upload date:
  • Size: 21.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fastblocks_ui-0.4.1.tar.gz
Algorithm Hash digest
SHA256 95d8071279bf461184bc1867c097bc65bc5207fe1e886c6cffcdea9ea45c086f
MD5 25f368abb97ea38fe10a84fca01e9ea1
BLAKE2b-256 547aa73745c9eb9797e3af9b61fba74607594bbf9e1c1498fa68d7473a00d3c1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fastblocks_ui-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 22.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fastblocks_ui-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 67b23528c76263c925281291fd9447f67d4f4082658dec3d5f0f7c46ab636375
MD5 bad3acad31168406015b20ceaf6f9173
BLAKE2b-256 64f3411db0715873ac3071bf039087a0973b04836fd05a60cd655ba109191d19

See more details on using hashes here.

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