Skip to main content

UIKitPR

The utility-first visual framework built for PyReact.

PyPI Python PyReact License: MIT Docs

Accessible components, themes, utility classes, and a native motion engine in one Python package, with no mandatory Node pipeline.

Website: https://wanbnn.github.io/uikitpr/

Why UIKitPR?

UIKitPR brings Tailwind-like composition and ready-made components to PyReact:

  • predictable utility classes such as flex, gap-4, and grid-cols-3;
  • Python components that return PyReact VNodes;
  • light, dark, and custom themes powered by CSS variables;
  • SSR, handlers, and properties compatible with PyReact's h();
  • CSS bundled in the wheel and exportable through the CLI;
  • motion with springs, timelines, stagger, scroll, events, and lifecycle;
  • fingerprinted web assets, manifests, updates, and Service Workers;
  • loaders, skeletons, and ready-to-use visual states;
  • no JavaScript dependency or compilation step.

Installation

prpm add uikitpr

You can also use pip install uikitpr.

Quick start

from uikitpr import Button, Card, CardBody, Heading, Stack, UIProvider


def App(props):
    return UIProvider(
        Card(
            CardBody(
                Stack(
                    Heading("Hello, PyReact!", level=1),
                    Button("Get started", variant="primary"),
                    gap=4,
                )
            )
        ),
        class_name="p-6",
        full_height=True,
    )

Components accept children directly or through h(Component, {"children": ...}). The explicit children property is important with current PyReact functional components.

Utilities

Use classes in className or class_name:

from uikitpr import Box, cx

Box(
    "Content",
    class_name=cx(
        "flex items-center gap-4 p-6 rounded shadow",
        {"bg-primary-soft": highlighted, "hidden": not visible},
    ),
)

The stylesheet includes flex/grid layout, spacing, sizing, typography, colors, borders, shadows, and responsive variants such as md-grid-cols-3.

Components

Group Components
Layout Box, Container, Stack, Grid, Divider
Typography Heading, Text, Badge
Actions Button, IconButton
Forms Input, Textarea, Select, Checkbox, Switch
Feedback Alert, Spinner, Progress, Modal
Data and navigation Card, Table, Navbar, Breadcrumb, Avatar

Unconsumed properties are forwarded to the DOM VNode, including onClick, aria-*, data-*, style, id, and name. See the component reference.

Themes

UIProvider includes the CSS and selects a theme:

UIProvider(AppContent(), theme="dark", full_height=True)

Create a branded theme with tokens:

from uikitpr import create_theme

brand = create_theme(
    "my-brand",
    primary="#ff006e",
    primary_hover="#d9005d",
    radius="1rem",
)

UIProvider(AppContent(), theme=brand)

Motion and interaction

UIProvider includes the UIKitPR Motion runtime by default:

from uikitpr import Motion, Spring, Transition

Motion(
    Card(...),
    preset="fade-up",
    trigger="in-view",
    while_hover={"transform": "translateY(-6px) scale(1.02)"},
    while_tap={"transform": "scale(.97)"},
    transition=Transition(
        duration=.7,
        spring=Spring(stiffness=170, damping=18),
    ),
)

The engine supports mount, in-view, click, hover, tap, focus, and scroll animations; presets and custom keyframes; spring physics; staggered groups; timelines; lifecycle events; declarative controls; dynamically added VNodes; and prefers-reduced-motion. See the Motion guide.

Web cache and deployment

CacheManager writes SHA-256-fingerprinted assets, an inspectable manifest, and a versioned Service Worker:

from pathlib import Path
from uikitpr import CacheManager, CachePolicy, cache_script, motion_script, stylesheet

cache = CacheManager(
    Path("public"),
    policy=CachePolicy(name="my-app", version="2026.07.27"),
)
css = cache.add_text("uikitpr.css", stylesheet())
motion = cache.add_text("uikitpr-motion.js", motion_script())
runtime = cache.add_text("uikitpr-cache.js", cache_script())
cache.finalize(precache=["./"])

The browser exposes window.UIKitPRCache.register(), refresh(), manifest(), status(), and clear(). See the cache guide.

Loaders and visual states

from uikitpr import OrbitLoader, Skeleton, SkeletonCard

OrbitLoader(size="lg")
Skeleton(lines=3)
SkeletonCard()

DotsLoader, BarsLoader, RingLoader, PulseLoader, WaveLoader, and PageLoader are also available.

External CSS and CSP

For strict Content Security Policy deployments, export and serve assets separately:

uikitpr css -o static/uikitpr.css
uikitpr css -o static/uikitpr.min.css --minify
uikitpr motion -o static/uikitpr-motion.js
uikitpr cache -o static/uikitpr-cache.js
from uikitpr import Styles

Styles(href="/static/uikitpr.css")
UIProvider(AppContent(), with_styles=False)

Client-only rendering also supports Styles(inline=True, nonce="...").

Development

prpm install
prpm test
prpm pack
prpm verify dist

The complete example is available in examples/dashboard.py. Build and serve the official website with prpm run site and prpm run serve.

Documentation

The complete English documentation is available on Read the Docs.

License

MIT. See LICENSE.

Metadata

Release files for uikitpr 0.3.2.post3028995321301

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uikitpr 0.3.2.post3028995321301
File Size Uploaded
uikitpr-0.3.2.post3028995321301.tar.gz 38.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for uikitpr 0.3.2.post3028995321301
File Interpreter ABI Platform
uikitpr-0.3.2.post3028995321301-py3-none-any.whl Python 3 none any Details

Total release size: 72.1 kB

Release files / uikitpr-0.3.2.post3028995321301.tar.gz

Download URL uikitpr-0.3.2.post3028995321301.tar.gz
Size 38.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e77b57ac2d0e76f66f992d87299994be5767213dab57a63f3e692fe87c2628c1
BLAKE2b-256 checksum
How to use checksums
813fa336fce2e806f3dd285a6e3147bd35e800706a1fb5d6bc8901bb4df5040a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 27, 2026.

Transparency log

Release files / uikitpr-0.3.2.post3028995321301-py3-none-any.whl

Download URL uikitpr-0.3.2.post3028995321301-py3-none-any.whl
Size 34.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a8c7e25807be5dec9fd120192344c560a6755d2db1842ff08577373acc3c2ae
BLAKE2b-256 checksum
How to use checksums
4bc9ba5d7789164814fd3472bd21affadcec4e1f2e71d63fab1c576f724d4df3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 27, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page