{% extends "bfx_preview/layout.html" %} {% from "bfx/button.html" import button %} {% from "bfx/input.html" import input %} {% from "bfx/select.html" import select %} {% from "bfx/textarea.html" import textarea %} {% from "bfx/form.html" import form_group, csrf_input %} {% from "bfx/alert.html" import alert %} {% from "bfx/card.html" import card %} {% from "bfx/nav.html" import nav %} {% block content %} {# ── Hero ──────────────────────────────────────── #}
Every bfx/ macro rendered live with copy-paste Jinja2 code. Import, pass your data, ship.
{% raw %}{{ input("email", type="email", label="Email address", placeholder="you@example.com") }}{% endraw %}
{% raw %}{{ input("email", type="email", label="Email", value="not-an-email",
error="Please enter a valid email address") }}{% endraw %}
{% raw %}{{ input("password", type="password", label="Password", required=true) }}{% endraw %}
{% raw %}{{ select("color", ["Red", "Green", "Blue"], label="Favorite color") }}{% endraw %}
{% raw %}{{ select("role", [
{"value": "admin", "label": "Administrator"},
{"value": "editor", "label": "Editor"},
{"value": "viewer", "label": "Viewer"}
], label="Role", selected="editor") }}{% endraw %}
{% raw %}{{ select("plan", ["Free", "Pro"], label="Plan", error="Selection required") }}{% endraw %}
{% raw %}{{ textarea("bio", label="Biography", placeholder="Tell us about yourself...") }}{% endraw %}
{% raw %}{{ textarea("bio", label="Biography", error="Must be at least 20 characters", rows=3) }}{% endraw %}
{% raw %}{% call form_group("Email address", for_id="email") %}
{{ input("email", type="email", placeholder="you@example.com") }}
{% endcall %}{% endraw %}
{% raw %}{% call form_group("Password", error="Password is required") %}
{{ input("password", type="password") }}
{% endcall %}{% endraw %}
{% raw %}{{ csrf_input(csrf_token) }}
{# Renders: #}{% endraw %}
A simple card with just content. Uses Pico's <article> element.
{% raw %}{% call card() %}
A simple card with just content.
{% endcall %}{% endraw %}
Card body content goes here. The title renders in a <header> and footer in a <footer>.
{% raw %}{% call card(title="User Profile", footer="Last updated: today") %}
Card body content goes here.
{% endcall %}{% endraw %}
{% raw %}{{ alert("This is an informational message.", variant="info") }}
{{ alert("Operation completed successfully!", variant="success") }}
{{ alert("Please check your input.", variant="warning") }}
{{ alert("Something went wrong.", variant="error") }}{% endraw %}
{% raw %}{{ alert("You can close this alert.", variant="info", dismissible=true) }}{% endraw %}