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.3.tar.gz
(5.5 kB
view details)
Built Distribution
File details
Details for the file reactpy_forms-0.0.3.tar.gz
.
File metadata
- Download URL: reactpy_forms-0.0.3.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 | cb7ab7706dbe0449e94dd3be24af561c221694434ed42e7be75d3e784c5a7afd |
|
MD5 | 394ad2d86139982a225caae3dd71ceb5 |
|
BLAKE2b-256 | fdb3e9f8450a66d15d8c33bab8b56a89c2eb1554c349d1dc30af871e16d02ce7 |
File details
Details for the file reactpy_forms-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: reactpy_forms-0.0.3-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 | 2dd61d546311b18a5347e0316a2eb8be3ba1a31fca9531ed41c15c6e65131b06 |
|
MD5 | e7980deaaca74050665dea768195483a |
|
BLAKE2b-256 | f51e367c1b9b46c8e64b7629ed4c19c6f34540378ffc697bdddc7269b19006b6 |