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
Release history Release notifications | RSS feed
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 hashes)
Built Distribution
Close
Hashes for reactpy_forms-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f15d9f96f725993f24c9e275a87e10cc192481e00bed230b43c593f0ae09d5af |
|
MD5 | 7ad0a0f705c4203a123cb32b8b82f7a7 |
|
BLAKE2b-256 | 2f21599abecef6d4ef50811bda4dc154b3c1d1c973c18e1ae8c5e0e7b82dac16 |