## reactpy-forms

Headless forms for ReactPy
### Features
- [X] Headless, CSS agnostic
- [X] Field validation
- [X] 100% fully typed python
## Usage
pip install reactpy-forms
[form_login.py](./examples/form_login.py)
```python
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)
)
```
[modularforms]: https://modularforms.dev/solid/guides/introduction
Raw data
{
"_id": null,
"home_page": "https://github.com/stevej2608/reactpy-forms/README.md",
"name": "reactpy-forms",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Steve Jones",
"author_email": "jonesst2608@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/52/86/4d77896e0d7fef422de7f47b04f023b21477f02a84717e5abb12e53639dc/reactpy_forms-0.0.8.tar.gz",
"platform": null,
"description": "## reactpy-forms\n\n\n\nHeadless forms for ReactPy\n\n### Features\n\n- [X] Headless, CSS agnostic\n- [X] Field validation \n- [X] 100% fully typed python\n\n\n## Usage\n\n\tpip install reactpy-forms\n\n[form_login.py](./examples/form_login.py)\n```python\n\nclass LoginFormData(FormModel):\n email: Union[str, None] = None\n password: Union[str, None] = None\n\n\n@component\ndef LoginForm():\n\n model, set_model = use_form_state(LoginFormData(email=\"joe@gmail.com\", password=\"1234\"))\n\n Form, Field = create_form(model, set_model)\n\n @event(prevent_default=True)\n def on_click(event: EventArgs):\n log.info('SUBMIT [%s]', model)\n\n return Form(\n html.h2(\"Login\"),\n Field('email', lambda props, field: TextInput('Email', field, props({'id': 'email', 'type':'email'}))),\n Field('password', lambda props, field: TextInput('Password', field, props({'id': 'password'}))),\n SubmitButton('Login', model, on_click=on_click)\n )\n\n```\n\n\n[modularforms]: https://modularforms.dev/solid/guides/introduction\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": null,
"version": "0.0.8",
"project_urls": {
"Homepage": "https://github.com/stevej2608/reactpy-forms/README.md",
"Repository": "https://github.com/stevej2608/reactpy-forms"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "83d0325b164aac449328689501328ba633e3f6f1b2025c1265104049bdd5a697",
"md5": "936411f625a8ef802eae28425a1de56f",
"sha256": "4f9f93bf7c6415e61176dfdc656c387a6f47069b322d16c1d2ab48ca39db5026"
},
"downloads": -1,
"filename": "reactpy_forms-0.0.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "936411f625a8ef802eae28425a1de56f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 6731,
"upload_time": "2025-01-07T09:10:30",
"upload_time_iso_8601": "2025-01-07T09:10:30.280483Z",
"url": "https://files.pythonhosted.org/packages/83/d0/325b164aac449328689501328ba633e3f6f1b2025c1265104049bdd5a697/reactpy_forms-0.0.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "52864d77896e0d7fef422de7f47b04f023b21477f02a84717e5abb12e53639dc",
"md5": "a78d478eb03f019ae59d29b740b999ef",
"sha256": "869571444faeb4e8654bc31a579639673633c34f12554d769e0cb00c1369d1fb"
},
"downloads": -1,
"filename": "reactpy_forms-0.0.8.tar.gz",
"has_sig": false,
"md5_digest": "a78d478eb03f019ae59d29b740b999ef",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 5658,
"upload_time": "2025-01-07T09:10:32",
"upload_time_iso_8601": "2025-01-07T09:10:32.615322Z",
"url": "https://files.pythonhosted.org/packages/52/86/4d77896e0d7fef422de7f47b04f023b21477f02a84717e5abb12e53639dc/reactpy_forms-0.0.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-07 09:10:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "stevej2608",
"github_project": "reactpy-forms",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "reactpy-forms"
}