File size: 1,533 Bytes
7798609 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
'''
title: Section
'''
import simplestart as ss
ss.md("## ss.section Container")
ss.md("The section parent container can hold other components and supports the style parameter.")
ss.space()
ss.md('''
#### π
Example
''')
#api
def clear():
section.empty()
def write_something():
section.text("Hello, I am inside section 2")
#ui
with ss.section("Section1", shadow = 10, border = True, rounded=True, width = "50%", height=300):
ss.text("This is inside the section 1")
ss.space()
section = ss.section()
section.text("This is inside the section 2")
ss.space("mt-4 mb-4")
ss.text("outside the section")
ss.md("---")
ss.button("clear", onclick=clear)
ss.button("add something", onclick=write_something)
ss.space()
ss.write("#### π Code")
ss.md("""
```python
import simplestart as ss
#api
def clear():
section.empty()
def write_something():
section.text("Hello, I am inside section 2")
#ui
with ss.section(title = "Section1", shadow = 10, border = True, rounded=True, width = "50%", height=300):
ss.text("This is inside the section 1")
ss.space()
section = ss.section()
section.text("This is inside the section 2")
ss.space()
ss.text("outside the section")
ss.md("---")
ss.button("clear", onclick=clear)
ss.button("add something", onclick=write_something)
```
""")
ss.md('''
::: tip
In addition to adding components using the with syntax, you can also directly add components within the container using section.text(), section.button(), etc.
:::
''') |