reactpy-forms
Headless forms for ReactPy
Features
- Headless, CSS agnostic
- Field validation
- 100% fully typed python
Usage
pip install reactpy-forms
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)
)
Metadata
Release files for reactpy-forms 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| reactpy_forms-0.0.8.tar.gz | 5.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| reactpy_forms-0.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.4 kB
Release files / reactpy_forms-0.0.8.tar.gz
| Download URL | reactpy_forms-0.0.8.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
869571444faeb4e8654bc31a579639673633c34f12554d769e0cb00c1369d1fb
|
|
BLAKE2b-256 checksum How to use checksums |
52864d77896e0d7fef422de7f47b04f023b21477f02a84717e5abb12e53639dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.11.4 Linux/5.15.167.4-microsoft-standard-WSL2
|
Release files / reactpy_forms-0.0.8-py3-none-any.whl
| Download URL | reactpy_forms-0.0.8-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4f9f93bf7c6415e61176dfdc656c387a6f47069b322d16c1d2ab48ca39db5026
|
|
BLAKE2b-256 checksum How to use checksums |
83d0325b164aac449328689501328ba633e3f6f1b2025c1265104049bdd5a697
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.11.4 Linux/5.15.167.4-microsoft-standard-WSL2
|