Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@vaadin-component-factory/vcf-nav
Advanced tools
Vaadin Component Factory component for navigation menus. This component is a stepping stone towards an official Vaadin component. Please provide feedback through issues in this repository.
Vaadin Component Factory component for navigation menus. This component is a stepping stone towards an official Vaadin component. Please provide feedback through issues in this repository.
Missing features (things that will be added in the official component):
Potential feature additions:
<vcf-nav collapsible>
<span slot="label">Main menu</span>
<vcf-nav-item path="/dashboard">
<vaadin-icon icon="vaadin:chart" slot="prefix"></vaadin-icon>
Dashboard
<span theme="badge primary" slot="suffix" aria-label="(2 new items)">2</span>
</vcf-nav-item>
<vcf-nav-item>
<vaadin-icon icon="vaadin:folder-open" slot="prefix"></vaadin-icon>
Parent
<vcf-nav-item path="/child1" slot="children">
Child 1
</vcf-nav-item>
<vcf-nav-item path="/child2" slot="children">
Child 2
</vcf-nav-item>
</vcf-nav-item>
</vcf-nav>
NOTE: The Java classes are not included in this repository. You can get them by downloading a starter project from start.vaadin.com.
AppNav nav = new AppNav("Main menu");
nav.setCollapsible(true);
AppNavItem dashboard = new AppNavItem("Dashboard", "/dashboard");
dashboard.setIcon(new Icon(VaadinIcon.CHART));
Span newItems = new Span("2");
newItems.getElement().setAttribute("aria-label", "(2 new items)");
newItems.getElement().getThemeList().add("badge primary");
newItems.getElement().setAttribute("slot", "suffix");
dashboard.getElement().appendChild(newItems.getElement());
AppNavItem parent = new AppNavItem("Parent");
parent.setIcon(new Icon(VaadinIcon.FOLDER_OPEN));
AppNavItem child1 = new AppNavItem("Child 1", "/child1");
AppNavItem child2 = new AppNavItem("Child 2", "/child2");
parent.addItem(child1, child2);
nav.addItem(dashboard, parent);
This component does not utilize the Vaadin ThemableMixin
interface, and therefore does not allow you to easily inject styles into its shadow DOM.
The component is meant to be styled using standard CSS features. Regular “light DOM” styling works for most things, and the ::part()
selector for more detailed styling.
Example:
frontend/themes/[mytheme]/styles.css
html {
--vcf-nav-child-indent: var(--lumo-space-m);
}
vcf-nav {
padding: 0;
font-size: var(--lumo-font-size-m);
color: var(--lumo-body-text-color);
}
vcf-nav::part(label) {
text-transform: uppercase;
font-size: var(--lumo-font-size-xs);
}
vcf-nav-item::part(item) {
border-inline-start: 2px solid transparent;
}
vcf-nav-item[active]::part(item) {
border-inline-start-color: var(--lumo-primary-color);
}
<vcf-nav>
::part(label)
The <summary>
element that displays the label of the navigation menu.
::part(label)::after
The expand/collapse icon of the label element. Defaults to var(--lumo-icons-dropdown)
.
[collapsible]
Indicates that the navigation menu is user-collapsible and the pseudo element for the expand/collapse icon is visible.
[collapsed]
Indicates that the navigation menu has been collapsed and the navigation items are hidden.
<vcf-nav-item>
NOTE: the navigation item applies styles to any prefix element with a class name that contains
"icon"
, assuming all such elements are meant to be the item icon.
::part(item)
The <a>
element that contains the item label and prefix and suffix content.
::part(toggle-button)
The <button>
element which contains the expand/collapse icon, if the item has child items.
::part(toggle-button)::before
The expand/collapse icon. Defaults to var(--lumo-icons-dropdown)
.
::part(children)
The <slot>
element that contains any child items. Can be styled visually.
[active]
Indicates that the item is currently the active/visible view in the application. This attribute is automatically set based on the current path/URL.
[child-active]
Indicates that a child item of this navigation item is currently active.
[expanded]
Indicates that the child items of this navigation item are visible.
--vcf-nav-child-indent
The amount of visual indentation of child items. Can be set globally in the html
element. Defaults to var(--lumo-space-l)
.
FAQs
Vaadin Component Factory component for navigation menus. This component is a stepping stone towards an official Vaadin component. Please provide feedback through issues in this repository.
The npm package @vaadin-component-factory/vcf-nav receives a total of 533 weekly downloads. As such, @vaadin-component-factory/vcf-nav popularity was classified as not popular.
We found that @vaadin-component-factory/vcf-nav demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.