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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: reactpy_forms-0.0.4.tar.gz
  • Upload date:
  • Size: 5.6 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.4.tar.gz
Algorithm Hash digest
SHA256 a57e20f57dcd3f3b319d4f0345c6e1924ffa4adf1ae1076bf86d17ef78a8db8e
MD5 80dc28a32f1c5357b993a58b00f390a0
BLAKE2b-256 3cefc99789f54f6b3b46a81a93a009e5c93e447481591eba6df0debce06f9dc3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: reactpy_forms-0.0.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0c8a630651ff0975ef3131232462d8032aafefa2491f99bc01c0591edd6d853e
MD5 829587fce99c8a5adbdf2b5c8b4665bd
BLAKE2b-256 3f2c34f164c2b3e573e6f4a47c717965a95c59aa1bbb9b479a848d9754d118b2

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