Skip to content

Commit

Permalink
Add demo for this
Browse files Browse the repository at this point in the history
  • Loading branch information
ischaojie committed Dec 28, 2023
1 parent 1e76553 commit c6d4dbc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
8 changes: 8 additions & 0 deletions demo/components_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,14 @@ class Delivery(BaseModel):
],
class_name='border-top mt-3 pt-1',
),
c.Div(
components=[
c.Heading(text='DarkMode', level=2),
c.Markdown(text='`DarkMode` can be used to toggle dark mode on and off.'),
c.DarkMode(),
],
class_name='border-top mt-3 pt-1',
),
c.Div(
components=[
c.Heading(text='Custom', level=2),
Expand Down
1 change: 1 addition & 0 deletions demo/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def api_index() -> list[AnyComponent]:
* `Image` - example [here](/components#image)
* `Iframe` - example [here](/components#iframe)
* `Video` - example [here](/components#video)
* `DarkMode` — example [here](/components#darkmode)
* `Table` — See [cities table](/table/cities) and [users table](/table/users)
* `Pagination` — See the bottom of the [cities table](/table/cities)
* `ModelForm` — See [forms](/forms/login)
Expand Down
3 changes: 0 additions & 3 deletions demo/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ def demo_page(*components: AnyComponent, title: str | None = None) -> list[AnyCo
on_click=GoToEvent(url='/forms/login'),
active='startswith:/forms',
),
c.Link(
components=[c.DarkMode()],
),
],
),
c.Page(
Expand Down

0 comments on commit c6d4dbc

Please sign in to comment.