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.6.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: reactpy_forms-0.0.6.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.6.tar.gz
Algorithm Hash digest
SHA256 037de04846ab68e28f9fb7b173026f4d396c7144e110d92d52a500ee846554e1
MD5 75dc28148e1c2b6885ea12fec70d39ec
BLAKE2b-256 2ace501ac7f019f93b452e0962b50d4b7b89ff14d6dc51ea9c14a36a118976b6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: reactpy_forms-0.0.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 7d0e97c0e80e83a31786fa3013de1dc22e74a69273d5715cec12956348794ebe
MD5 219d370ff4037e5b78c2aa91650add12
BLAKE2b-256 cf4b3cd64c0dfbef51217341adba0de8aa096a095f9b98d4eb254a2441513757

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