Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(sidebar): add collapsed width guide for icon variant #6197

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions apps/www/content/docs/components/sidebar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,11 @@ const SIDEBAR_WIDTH = "16rem"
const SIDEBAR_WIDTH_MOBILE = "18rem"
```

For collapsed widht in icon variant sidebar
```tsx showLineNumbers title="components/ui/sidebar.tsx"
const SIDEBAR_WIDTH_ICON = "3rem"
```

For multiple sidebars in your application, you can use the `style` prop to set the width of the sidebar.

To set the width of the sidebar, you can use the `--sidebar-width` and `--sidebar-width-mobile` CSS variables in the `style` prop.
Expand All @@ -386,6 +391,7 @@ To set the width of the sidebar, you can use the `--sidebar-width` and `--sideba
style={{
"--sidebar-width": "20rem",
"--sidebar-width-mobile": "20rem",
"--sidebar-width-icon": "3.5rem", // for icon variant sidebar, width when collapsed
}}
>
<Sidebar />
Expand Down