Skip to main content

InstaUI TDesign

Project description

instaui-tdesign

English|简体中文

📖 Introduction instaui-tdesign is a UI component library for InstaUI, built on top of TDesign.

📦 Installation

pip install instaui-tdesign -U
uv add instaui-tdesign

🖥️ Quick Start

from instaui import ui
from instaui_tdesign import td

td.use(locale="en_US")

@ui.page('/')
def home():
    info = ui.state(
        {
            "name": "",
            "age": 0,
        }
    )

    @ui.computed(inputs=[info])
    def disabled_submit(info: dict) -> bool:
        return info["name"] == "" or info["age"] == 0

    @ui.event(inputs=[info])
    def handle_submit(info: dict):
        # Operations such as printing, writing to a database, etc.
        print(info)

    # ui
    with ui.container(size="1"), ui.column():
        ui.text(info)

        td.input(info["name"], label="NAME")
        td.input_number(info["age"], label="AGE", theme="row", min=0, max=100)
        td.button("submit", disabled=disabled_submit, on_click=handle_submit)

ui.server(debug=True).run()

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

instaui_tdesign-0.5.0.tar.gz (469.5 kB view details)

Uploaded Source

Built Distribution

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

instaui_tdesign-0.5.0-py3-none-any.whl (536.8 kB view details)

Uploaded Python 3

File details

Details for the file instaui_tdesign-0.5.0.tar.gz.

File metadata

  • Download URL: instaui_tdesign-0.5.0.tar.gz
  • Upload date:
  • Size: 469.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for instaui_tdesign-0.5.0.tar.gz
Algorithm Hash digest
SHA256 75003c2783652dccff07dcbad2b81ac42d01f1e74f68b6948fdfe8cbb6788bde
MD5 61ec22385484c55ccb9567e4c866f230
BLAKE2b-256 5710df4dfc21e3fdaa2a69d51281da747f7b5efd716f65ff9ef5a1519928b955

See more details on using hashes here.

File details

Details for the file instaui_tdesign-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for instaui_tdesign-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be3b9b1149323cd39baa412780e219c359a61ce7527c151c93df4798766ed69a
MD5 48f9681017953540a6636203a5c0b7f6
BLAKE2b-256 fdd6fd3a6cf8bc8eba9dad45a2429aac3f1bdc6dd01aef4e7e153653f6fb689c

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