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.3.tar.gz (472.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.3-py3-none-any.whl (539.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for instaui_tdesign-0.5.3.tar.gz
Algorithm Hash digest
SHA256 67a14387f7dcef9b2e99e6175dcd05849ae4f51961960822a194bdb46cd526ce
MD5 e2b8590acca353a919b28935bb385470
BLAKE2b-256 5dd3f9fcd8e19feb7f06ef7af401e88cdb4ac5ef9428b0e7792b6e9b36f9bf7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for instaui_tdesign-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 aaf05b54a073f33f1fcd404cd36391b417111c4a8d7a29c46719593e3e9399ca
MD5 22662a24b2a0df61f2d09ff0d5de81d3
BLAKE2b-256 8c31e2c34db15a070b7d4e12fad28ee49ff212648b8b6a3aa0cb55fafa908a66

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