Dock is a navigation component consisting of menuitems.
import { DockModule } from 'primeng/dock';
Dock requires a collection of menuitems as its model. Default location is bottom and other sides are also available when defined with the position property. Content of the dock component is defined by item template.
<p-dock [model]="items" [position]="position">
<ng-template pTemplate="item" let-item>
<img [src]="item.icon" [alt]="item.label" width="100%" />
</ng-template>
</p-dock>
Dock requires a collection of menuitems as its model. Default location is bottom and other sides are also available when defined with the position property. Content of the dock component is defined by item template.
<p-menubar [model]="menubarItems">
<ng-template pTemplate="start">
<i class="pi pi-apple px-2"></i>
</ng-template>
<ng-template pTemplate="end">
<i class="pi pi-video px-2"></i>
<i class="pi pi-wifi px-2"></i>
<i class="pi pi-volume-up px-2"></i>
<span>Fri 13:07</span>
<i class="pi pi-search px-2"></i>
<i class="pi pi-bars px-2"></i>
</ng-template>
</p-menubar>
<div class="dock-window dock-advanced">
<p-dock [model]="dockItems" position="bottom">
<ng-template pTemplate="item" let-item>
<img [src]="item.icon" [alt]="item.label" width="100%" />
</ng-template>
</p-dock>
<p-toast position="top-center" key="tc" />
<p-dialog
[(visible)]="displayFinder"
[breakpoints]="{ '960px': '50vw' }"
[style]="{ width: '30vw', height: '18rem' }"
[draggable]="false"
[resizable]="false">
<p-tree [value]="nodes" />
</p-dialog>
<p-dialog
[maximizable]="true"
[(visible)]="displayTerminal"
[breakpoints]="{ '960px': '50vw' }"
[style]="{ width: '30vw' }"
[draggable]="false"
[resizable]="false">
<p-terminal
welcomeMessage="Welcome to PrimeNG (cmd: 'date', 'greet {0}', 'random')"
prompt="primeng $" />
</p-dialog>
<p-galleria
[(value)]="images"
[showThumbnails]="false"
[showThumbnailNavigators]="false"
[showItemNavigators]="true"
[(visible)]="displayGalleria"
[circular]="true"
[responsiveOptions]="responsiveOptions"
[containerStyle]="{ 'max-width': '850px' }"
[circular]="true"
[fullScreen]="true">
<ng-template pTemplate="item" let-item>
<img [src]="item.itemImageSrc" style="width: 100%; display: block;" />
</ng-template>
</p-galleria>
</div>
Following is the list of structural style classes, for theming classes visit theming page.
Name | Element |
---|---|
p-dock | Container element. |
p-dock-list | List of items. |
p-dock-item | Each items in list. |
Dock component uses the menu role with the aria-orientation and the value to describe the menu can either be provided with aria-labelledby or aria-label props. Each list item has a presentation role whereas anchor elements have a menuitem role with aria-label referring to the label of the item and aria-disabled defined if the item is disabled.
Key | Function |
---|---|
tab | Add focus to the first item if focus moves in to the menu. If the focus is already within the menu, focus moves to the next focusable item in the page tab sequence. |
shift + tab | Add focus to the last item if focus moves in to the menu. If the focus is already within the menu, focus moves to the previous focusable item in the page tab sequence. |
enter | Activates the focused menuitem. |
space | Activates the focused menuitem. |
down arrow | Moves focus to the next menuitem in vertical layout. |
up arrow | Moves focus to the previous menuitem in vertical layout. |
home | Moves focus to the first menuitem in horizontal layout. |
end | Moves focus to the last menuitem in horizontal layout. |
API defines helper props, events and others for the PrimeNG Dock module.
Dock is a navigation component consisting of menuitems.
Defines the input properties of the component.
Defines emit that determine the behavior of the component based on a given condition or report the actions that the component takes.
Defines the templates used by the component.
Defines the custom interfaces used by the module.
MenuItem provides the following properties. Note that not all of them may be utilized by the tabmenu component.