Skip to main content

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 on_click(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, on_click=on_click)
    )

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

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for reactpy_forms-0.0.8.tar.gz
Algorithm Hash digest
SHA256 869571444faeb4e8654bc31a579639673633c34f12554d769e0cb00c1369d1fb
MD5 a78d478eb03f019ae59d29b740b999ef
BLAKE2b-256 52864d77896e0d7fef422de7f47b04f023b21477f02a84717e5abb12e53639dc

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for reactpy_forms-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 4f9f93bf7c6415e61176dfdc656c387a6f47069b322d16c1d2ab48ca39db5026
MD5 936411f625a8ef802eae28425a1de56f
BLAKE2b-256 83d0325b164aac449328689501328ba633e3f6f1b2025c1265104049bdd5a697

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.8 This release

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page