Dock

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"></i>
    </ng-template>
    <ng-template pTemplate="end">
        <i class="pi pi-video"></i>
        <i class="pi pi-wifi"></i>
        <i class="pi pi-volume-up"></i>
        <span>Fri 13:07</span>
        <i class="pi pi-search"></i>
        <i class="pi pi-bars"></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></p-toast>

    <p-dialog [(visible)]="displayFinder" [breakpoints]="{ '960px': '50vw' }" [style]="{ width: '30vw', height: '18rem' }" [draggable]="false" [resizable]="false">
        <p-tree [value]="nodes"></p-tree>
    </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-terminal>
    </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.previewImageSrc" style="width: 100%; display: block;" />
        </ng-template>
    </p-galleria>
</div>

Following is the list of structural style classes, for theming classes visit theming page.

NameElement
p-dockContainer element.
p-dock-listList of items.
p-dock-itemEach items in list.

Screen Reader

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.

Keyboard Support

KeyFunction
tabAdd 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 + tabAdd 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.
enterActivates the focused menuitem.
spaceActivates the focused menuitem.
down arrowMoves focus to the next menuitem in vertical layout.
up arrowMoves focus to the previous menuitem in vertical layout.
homeMoves focus to the first menuitem in horizontal layout.
endMoves focus to the last menuitem in horizontal layout.