Add radio group (#1963)

* add radio group

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Fabio Pliger <fpliger@users.noreply.github.com>
This commit is contained in:
Askat
2024-02-02 15:40:10 -06:00
committed by GitHub
parent d101d7d755
commit 0791890d0d
2 changed files with 72 additions and 3 deletions

View File

@@ -30,6 +30,7 @@ from pyweb.ui.shoelace import (
Divider,
Icon,
Radio,
RadioGroup,
Range,
Rating,
RelativeTime,
@@ -138,6 +139,25 @@ Card(p("This is a cool card!"), image="https://pyscript.net/assets/images/pyscri
"code": "Rating()",
},
"Radio": {
"instance": Radio("Option 42"),
"code": el.code('Radio("Option 42")'),
},
"Radio Group": {
"instance": RadioGroup(
[
Radio("radio 1", name="radio 1", value=1, style={"margin": "20px"}),
Radio("radio 2", name="radio 2", value=2, style={"margin": "20px"}),
Radio("radio 3", name="radio 3", value=3, style={"margin": "20px"}),
],
label="Select an option",
),
"code": el.code(
"""
RadioGroup([Radio("radio 1", name="radio 1", value=1, style={"margin": "20px"}),
Radio("radio 2", name="radio 2", value=2, style={"margin": "20px"}),
Radio("radio 3", name="radio 3", value=3, style={"margin": "20px"})],
label="Select an option"),"""
),
"instance": Radio(),
"code": "Radio()",
},