Skip to main content

FastBlocks UI: HTML/CSS-first styling and component helpers for FastBlocks

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 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.0.tar.gz (21.6 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.0-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastblocks_ui-0.4.0.tar.gz
  • Upload date:
  • Size: 21.6 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.0.tar.gz
Algorithm Hash digest
SHA256 a6c109ad2fa4d08ddbfbf6012c1b0c3ef3b26126f23e9834d532bf8e5b3e1b7c
MD5 7001f82ecf528be8b6f72e8c8c3410e3
BLAKE2b-256 6826d3b2e8a6c0335398591eb3c3a99372ec567103345bfbe8e4a2f48755a3a9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fastblocks_ui-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 22.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 18001111bf82c57cedbe31e5a6b02c1cce575a24a4376b5271172a63b1e99e9f
MD5 54e7884222851027f452d01344a03616
BLAKE2b-256 13f4373b36d572753ecd223889d8e586bd15806f27c94f05e4f4799c733d50fe

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