Note: The Side Navigation has been deprecated. Instead please use the Left Navigation.
<vega-flex>
<div data-shrink="0">
<vega-sidenav footnote="Version 2.0.0" open-by-default="disableCollapse">
<vega-sidenav-link icon="hb-menu" url="#">Company Name</vega-sidenav-link>
<vega-sidenav-link icon="fas fa-shopping-bag fa-lg" url="#"
>Order Equipment</vega-sidenav-link
>
<vega-sidenav-group icon="fas fa-file-alt fa-lg" label="Dashboard">
<vega-sidenav-link url="#">Form W-9</vega-sidenav-link>
<vega-sidenav-link url="#" selected="true"
>Form W-8BEN</vega-sidenav-link
>
<vega-sidenav-link url="#"
>Very very very very very very very very long title</vega-sidenav-link
>
</vega-sidenav-group>
<vega-sidenav-group icon="fas fa-user fa-lg" label="Main Heading">
<vega-sidenav-link url="#">Sub-Heading</vega-sidenav-link>
<vega-sidenav-link url="#">Sub-Heading</vega-sidenav-link>
<vega-sidenav-link url="#">Sub-Heading</vega-sidenav-link>
</vega-sidenav-group>
<vega-sidenav-link icon="fas fa-comment-dots fa-lg" url="#"
>Support</vega-sidenav-link
>
</vega-sidenav>
</div>
<div>
<!-- Main Content -->
</div>
</vega-flex>
The vega-sidenav
is a complex fully contained component which will provide two different navigation interfaces: one for larger screens and one for mobile devices.
It contains other complex components, including the vega-sidenav-group
and the vega-sidenav-link.
To use the vega-sidenav
component properly, it is recommended to use it inside a vega-flex component as shown:
<body>
<vega-flex>
<div data-shrink="0">
<vega-sidenav>
<!-- the mix of <vega-sidenav-group> and <vega-sidenav-link> -->
</vega-sidenav>
</div>
<div>
<!-- Main Content -->
</div>
</vega-flex>
</body>
You may use vega-sidenav-group
to group together listings of links with the vega-sidenav-link
component as shown:
<vega-sidenav-group icon="XXX" label="XXX">
<!-- a list of <vega-sidenav-link> -->
</vega-sidenav-group>
Name | Description | Default |
---|---|---|
footnote | The footnote of the sidenav string | "" |
source | The data source of the sidenav array | |
headerConfig | The header config of the sidenav. collapseLogo, expandLogo type is an image src Object<{headline: "string", expandLogo: "string", collapseLogo: "string"} > |
|
open-by-default | Optional values are “open”, “close”, and “disableCollapse” (Note: this will only work when the screen width is larger or equal to 1024px). By setting this value to “open” you can force the sidenav to be open for screens larger or equal to 1024px. Note: The openByDefault property can only be set once for initialization and cannot be overridden. | close |
show-side-bar-on-click-link | Indicator allowing the sidebar to close on clicking. Boolean | false |
In mobile view, the sidenav is hidden by default, but will instead show a hamburger menu which will then display the side navigation as an overlay.
Note:
The expandLogo
and collapseLogo
in the header-config property support customization. The image can be displayed using the path of the image. When using expandLogo
, we recommend using an image with a width and height of 142 x 26px, and a maximum height of 80px.
collapseLogo
supports a fixed width and height of 56px.
As shown in the above example, we recommend using <vega-sidenav>
inside <vega-flex>
to ensure it works as designed.
For more details, view in Storybook.
toggle()
attribute to be default as “open” so that all users see the content of the menu, but provide the option to close it.