Skip to main content

Smarty UI

A UI components framework for building DivKit widgets for Smarty, aligned with the Smartbank Figma design system.

Overview

Smarty UI provides a layered component architecture built on top of pydivkit:

  • Tokens - Design system values (colors, typography, spacing)
  • Primitives - Basic UI atoms (text, buttons, images, dividers)
  • Composites - Reusable molecules (badges, input fields, status bubbles)
  • Blocks - Complete UI patterns (cards, lists, widgets)

Installation

pip install -e .

Quick Start

import pydivkit as dk
from smart_ui import (
    # Layout helpers
    HStack, VStack,
    # Primitives
    title_1, text_1, primary_button, smarty_button,
    # Blocks
    transaction_success_widget, payment_status_widget,
    home_balance_widget,
    # Theme
    default_theme,
)

# Create a simple card
card = VStack(
    [
        title_1("Hello, Smarty!"),
        text_1("Welcome to the UI framework."),
        primary_button("Get Started", action_url="div-action://start"),
    ],
    gap=12,
    padding=16,
    background="#FFFFFF",
    corner_radius=12,
)

# Create a transaction status widget
widget = transaction_success_widget(
    amount="200 000",
    recipient="ALEKSANDR GURYANOV ** 2221",
    date_time="3 сентября 2023 18:27",
)

Components

Layout Helpers

# Horizontal stack (row)
HStack([item1, item2, item3], gap=8, align_v="center")

# Vertical stack (column)  
VStack([header, content, footer], gap=12, align_h="left", padding=16)

Primitives

Component Description
title_1, title_2 Heading text styles
text_1, text_2, text_3 Body text styles
caption_1, caption_2, caption_3 Small text styles
primary_button, secondary_button Button variants
outline_button, smarty_button Outline button styles
icon, avatar, cover_image Image components
divider, h_spacer, v_spacer Layout utilities

Composites

Component Description
status_bubble Transaction/payment status display
chat_bubble Chat message bubbles
badge, outline_badge Label badges
icon_label Icon + text pair
input_field Text input field
card_balance_item Card balance row

Blocks

Component Description
transaction_success_widget Successful transfer status
transaction_failed_widget Failed transfer status
transaction_pending_widget Pending transfer status
payment_success_widget Successful payment status
payment_failed_widget Failed payment status
payment_pending_widget Pending payment status
home_balance_widget Utility balances widget
balance_widget Card/account balances
bank_card Bank card display
service_list Service categories list
contacts_list Contact list

Theming

from smart_ui import default_theme, dark_theme, Theme, ColorTokens

# Use default Smartbank theme
widget = balance_widget(total_balance="1 000 000", theme=default_theme)

# Use dark theme
widget = balance_widget(total_balance="1 000 000", theme=dark_theme)

# Create custom theme
custom_theme = Theme(
    colors=ColorTokens(
        primary="#FF5722",
        background="#FAFAFA",
    )
)

Project Structure

src/smart_ui/
├── tokens/           # Design tokens
│   ├── colors.py     # Color palette
│   ├── typography.py # Font styles
│   └── spacing.py    # Spacing scale
├── primitives/       # Basic UI atoms
│   ├── text.py       # Text components
│   ├── button.py     # Button variants
│   ├── image.py      # Image components
│   └── smarty_button.py
├── composites/       # Reusable molecules
│   ├── status_bubble.py
│   ├── chat_bubble.py
│   └── ...
├── blocks/           # Complete UI patterns
│   ├── transaction_status_widget.py
│   ├── payment_status_widget.py
│   ├── home_balance_widget.py
│   └── ...
└── _helpers.py       # Layout utilities (HStack, VStack)

License

Internal use only.

Metadata

Release files for smarty-ui 0.1.2

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

Source distribution (sdist)

Source distribution for smarty-ui 0.1.2
File Size Uploaded Provenance Actions
smarty_ui-0.1.2.tar.gz 100.7 kB Without provenance Details for smarty_ui-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for smarty-ui 0.1.2
File Interpreter ABI Platform Actions
smarty_ui-0.1.2-py3-none-any.whl Python 3 none any Details for smarty_ui-0.1.2-py3-none-any.whl

Total release size: 262.8 kB

Release files / smarty_ui-0.1.2.tar.gz

Download URL smarty_ui-0.1.2.tar.gz
Size 100.7 kB
Tags Source
SHA-256 checksum
How to use checksums
09297539ee553a8716df860666b19afc8013dbd6770da5ea1fc6797516a6fb44
BLAKE2b-256 checksum
How to use checksums
625ee3cbcd987febdf9592aa19a31c0c0b571221c6bae56c4210f9d1811dd5cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.13.3 Linux/6.12.9-200.fc41.x86_64

Release files / smarty_ui-0.1.2-py3-none-any.whl

Download URL smarty_ui-0.1.2-py3-none-any.whl
Size 162.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0deb03c916b76ce3b6d9497b1a057796282b145b0a3606c60d08818b99d3fbf8
BLAKE2b-256 checksum
How to use checksums
3387f46fc575c1b6c46083bb9134bf4b051bd946b2188a0ea2a3a3832078bc71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.13.3 Linux/6.12.9-200.fc41.x86_64

Security for smarty-ui 0.1.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

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