Sidebar #
va-sidebar is a column to store navigation or secondary information of your app.
Examples #
Default #
Default usage of va-sidebar
Sidebar items from config #
Usually you want to store sidebar items in config and render them programmatically. In example below you can learn how to conditionally render sidebar items using VaAccordion, VaCollapse and VaSidebarItem components.
Minimized #
You can minimize sidebar using minimized prop
Width #
Define custom width of sidebar in maximized state.
Minimized width #
Width of va-sidebar when minimized.
Color #
Change background color of a sidebar.
Gradient background #
You can make Navbar background gradient
Position #
Align va-sidebar to the left or right.
Hoverable #
Manage your sidebar state using hoverable prop. It allows to expand 'va-sidebar' on hover.
V-model #
Use v-model to enable/disable va-sidebar.
API #
Props #
| Name | Description | Types | Default |
|---|---|---|---|
| activeColor | The color for active |
|
|
| animated | Sets css |
|
|
| borderColor | Color CSS style |
| - |
| closeOnClickOutside | Dropdown will be closed when clicked outside dropdown content and anchor |
|
|
| color | Color of the component (theme string or |
|
|
| gradient | Adds a background gradient. |
|
|
| hoverable | Expand sidebar on hover. |
|
|
| hoverColor | The color for hovered |
| - |
| hoverOpacity | Opacity value for |
|
|
| minimized | Minimized state of sidebar. |
|
|
| minimizedWidth | Width of component in minimized state. |
|
|
| modelValue | The value of the |
|
|
| preset | Named preset combination of component props. |
| - |
| textColor | Text color (theme string or HEX string). |
| - |
| width | Width of component in maximized state. |
|
|
Events #
| Name | Description |
|---|---|
update:modelValue | The event is triggered when the component needs to change the model. Is also used by |
Css Variables #
| Name | Default Value |
|---|---|
| --va-sidebar-min-height | 100% |
| --va-sidebar-height | 100% |
| --va-sidebar-position | relative |
| --va-sidebar-top | 0 |
| --va-sidebar-left | 0 |
| --va-sidebar-transition | var(--va-transition) |
| --va-sidebar-z-index | 1 |
| --va-sidebar-menu-max-height | 100% |
| --va-sidebar-menu-margin-bottom | 0 |
| --va-sidebar-menu-list-style | none |
| --va-sidebar-menu-padding-left | 0 |
| --va-sidebar-menu-overflow-y | auto |
| --va-sidebar-menu-overflow-x | visible |
| --va-sidebar-item-active-border-size | 4px |
| --va-sidebar-item-transition | var(--va-transition) |
| --va-sidebar-item-content-padding | 1rem |
| --va-sidebar-item-content-gap | 0.5rem |
| --va-sidebar-item-title-white-space | nowrap |
FAQ #
What if minimized conflicts with hoverable? #
minimized conflicts with hoverable?What if minimized conflicts with hoverable?