8000 Pyscript/1960 pyweb UI elements by fpliger · Pull Request #100 · pyscript/docs · GitHub
[go: up one dir, main page]

Skip to content

Pyscript/1960 pyweb UI elements #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add element creation section
  • Loading branch information
fpliger committed May 14, 2024
commit 5bc1965102a847b4ab5d93454a0eef2a47a139ff
13 changes: 13 additions & 0 deletions docs/user-guide/dom.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,19 @@ pydom Element API.
We welcome feedback and suggestions.


#### Creating a new element

The element creation API provided by `pyweb.ui.elements` is focused on being simple
and idiomatic. In fact, to create an element simply instantiate the type of element
you need, providing all the properties supported by that element. Here's an example
of creating a new button with a custom style

```python
# This will change the text of all H1 elements in the page
from pyweb.ui.elements import button
btn_open_dialog = button("Open Dialog", title='open dialog button', draggable=True, style={margin: '5px'})
```


## Working with JavaScript

Expand Down
0