Skip to content

Commit

Permalink
Update hide_pages instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
blackary committed Nov 20, 2023
1 parent b9175bb commit cbde28d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
5 changes: 1 addition & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ repos:
- id: ruff
args:
- --fix
- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
- id: black
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.0
hooks:
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,16 @@ You can now pass a list of page names to `hide_pages` to hide pages dynamically
user. Note that these pages are only hidden via CSS, and can still be visited by the URL.
However, this could be a good option if you simply want a way to visually direct your
user where they should be able to go next.

NOTE: You should only hide pages that have also been added to the sidebar already.

```py
show_pages(
[
Page("streamlit_app.py", "Home", "🏠"),
Page("another.py", "Another page"),
]
)

hide_pages(["Another page"])
```

0 comments on commit cbde28d

Please sign in to comment.