Skip to content

Commit

Permalink
docs: update code example error component (#898)
Browse files Browse the repository at this point in the history
* docs update code error

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

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

* docs update code error

* docs update code in error-2

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

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

* docs_update_code_error_3

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Iisakki Rotko <[email protected]>
  • Loading branch information
3 people authored Jan 23, 2025
1 parent bd58933 commit 058a885
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions solara/website/pages/documentation/components/status/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,23 @@

@solara.component
def Page():
icon, set_icon = solara.use_state(True)
dense, set_dense = solara.use_state(False)
outlined, set_outlined = solara.use_state(True)
text, set_text = solara.use_state(True)
with solara.VBox() as main:
with solara.GridFixed(4):
solara.Checkbox(label="Use icon", value=icon, on_value=set_icon)
solara.Checkbox(label="Show dense", value=dense, on_value=set_dense)
solara.Checkbox(label="Show as text", value=text, on_value=set_text)
solara.Checkbox(label="Show outlined", value=outlined, on_value=set_outlined)
solara.Error(
f"This is solara.Error(label='...', text={text}, dense={dense}, outlined={outlined}, icon={icon})",
text=text,
dense=dense,
outlined=outlined,
icon=icon,
)
return main
icon = solara.use_reactive(True)
dense = solara.use_reactive(False)
outlined = solara.use_reactive(True)
text = solara.use_reactive(True)

with solara.GridFixed(4):
solara.Checkbox(label="Use icon", value=icon)
solara.Checkbox(label="Show dense", value=dense)
solara.Checkbox(label="Show as text", value=text)
solara.Checkbox(label="Show outlined", value=outlined)
solara.Error(
f"This is solara.Error(label='...', text={text.value}, dense={dense.value}, outlined={outlined.value}, icon={icon.value})",
text=text.value,
dense=dense.value,
outlined=outlined.value,
icon=icon.value,
)


__doc__ += apidoc(solara.Error.f) # type: ignore

0 comments on commit 058a885

Please sign in to comment.