Skip to main content

No project description provided

Project description

reactpy-forms

Headless forms for ReactPy

Features

  • Headless, CSS agnostic
  • Field validation
  • 100% fully typed python

Usage

pip install reactpy-forms

form_login.py

class LoginFormData(FormModel):
    email: Union[str, None] = None
    password: Union[str, None] = None


@component
def LoginForm():

    model, set_model = use_form_state(LoginFormData(email="joe@gmail.com", password="1234"))

    Form, Field = create_form(model, set_model)

    @event(prevent_default=True)
    def onclick(event: EventArgs):
        log.info('SUBMIT [%s]', model)

    return Form(
        html.h2("Login"),
        Field('email', lambda  props, field: TextInput('Email', field, props({'id': 'email', 'type':'email'}))),
        Field('password', lambda  props, field: TextInput('Password', field, props({'id': 'password'}))),
        SubmitButton('Login', model, onclick=onclick)
    )

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

reactpy_forms-0.0.5.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

reactpy_forms-0.0.5-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file reactpy_forms-0.0.5.tar.gz.

File metadata

  • Download URL: reactpy_forms-0.0.5.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.4 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for reactpy_forms-0.0.5.tar.gz
Algorithm Hash digest
SHA256 41c3fe77f6824c847701c87651dbff4ff02259b7cb1fbb97b1b460a5dfb8f6e0
MD5 6e6149bf1ec3778a555490841d061e00
BLAKE2b-256 fe0bb08fdf10811bb452c50ec5b0cc5e2888762f36758f82f4922b70738ff476

See more details on using hashes here.

File details

Details for the file reactpy_forms-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: reactpy_forms-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.4 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for reactpy_forms-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7593d3c8f2c1ccb6de2fbaf6a427ac5ea6b35c74ffc3485e8ef9b9597490adf5
MD5 7122f94f306c028feac47f337c6144dc
BLAKE2b-256 3487146fb3015728bdc4e93a26cbf4854b1700b707d52131b485229b5576594e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page