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 onclick(event: EventArgs):
log.info('SUBMIT [%s]', model)
return Form(
html.h2("Login"),
Field('email', lambda field, props: TextInput('Email', field, props({'id': 'email', 'type':'email'}))),
Field('password', lambda field, props: 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.2.tar.gz
(5.5 kB
view details)
Built Distribution
File details
Details for the file reactpy_forms-0.0.2.tar.gz
.
File metadata
- Download URL: reactpy_forms-0.0.2.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.4 Linux/5.15.146.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 000c8431f945b883398b52323a07e73bcb18d7a279b5e1b2819a2db9797eaea3 |
|
MD5 | 68ddceedcaca1ab6cd55374eb695fdbf |
|
BLAKE2b-256 | 88b286f0732b1cf35ea1f87528fc156d8bf21272cdc0e097c0aabd622603bc24 |
File details
Details for the file reactpy_forms-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: reactpy_forms-0.0.2-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.4 Linux/5.15.146.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f15d9f96f725993f24c9e275a87e10cc192481e00bed230b43c593f0ae09d5af |
|
MD5 | 7ad0a0f705c4203a123cb32b8b82f7a7 |
|
BLAKE2b-256 | 2f21599abecef6d4ef50811bda4dc154b3c1d1c973c18e1ae8c5e0e7b82dac16 |