Skip to content

Commit

Permalink
docs(sidebar): add collapsed width guide for icon variant
Browse files Browse the repository at this point in the history
  • Loading branch information
aumirza committed Dec 28, 2024
1 parent 1081536 commit a1c82a4
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit a1c82a4

Please sign in to comment.