10000 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 working with elements children section
  • Loading branch information
fpliger committed May 14, 2024
commit 64f7ef479166a3606b4527e7e5668f0965eeabc0
18 changes: 18 additions & 0 deletions docs/user-guide/dom.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,24 @@ from pyweb.ui.elements import button
btn_open_dialog = button("Open Dialog", title='open dialog button', draggable=True, style={margin: '5px'})
```

#### Working with container elements

Many elements are meant to be container elements and have children under them.
`pyweb.ui.elements` provides 2 mains ways to add children to an element:


##### specifing the children of an element during creation

Elements that support children, like `div`, allow users to specify their children
elements during the `Element` creation. For instance, let's modify the example above
to create the button inside a div.

```python
from pyweb.ui.elements import button
btn_open_dialog = button("Open Dialog", title='open dialog button', draggable=True, style={margin: '5px'})
page_div = div([button])
```


## Working with JavaScript

Expand Down
0