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
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)
)
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.8.tar.gz
(5.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
869571444faeb4e8654bc31a579639673633c34f12554d769e0cb00c1369d1fb
|
|
| MD5 |
a78d478eb03f019ae59d29b740b999ef
|
|
| BLAKE2b-256 |
52864d77896e0d7fef422de7f47b04f023b21477f02a84717e5abb12e53639dc
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f9f93bf7c6415e61176dfdc656c387a6f47069b322d16c1d2ab48ca39db5026
|
|
| MD5 |
936411f625a8ef802eae28425a1de56f
|
|
| BLAKE2b-256 |
83d0325b164aac449328689501328ba633e3f6f1b2025c1265104049bdd5a697
|