Toolbar is a grouping component for buttons and other content.
import Toolbar from 'primevue/toolbar';
Toolbar provides start, center and end properties to place content at these sections.
<Toolbar>
<template #start>
<Button icon="pi pi-plus" class="mr-2" />
<Button icon="pi pi-print" class="mr-2" />
<Button icon="pi pi-upload" />
</template>
<template #center>
<span class="p-input-icon-left">
<i class="pi pi-search" />
<InputText placeholder="Search" />
</span>
</template>
<template #end> <SplitButton label="Save" icon="pi pi-check" :model="items"></SplitButton></template>
</Toolbar>
A customized toolbar with navigation bar like functionality.
<Toolbar class="bg-gray-900 shadow-2" style="border-radius: 3rem; background-image: linear-gradient(to right, var(--bluegray-500), var(--bluegray-800))">
<template #start>
<svg width="35" height="40" viewBox="0 0 35 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="..." fill="#ffffff"" />
<path d="..." fill="#10b981" />
</svg>
</template>
<template #center>
<div class="flex flex-wrap align-items-center gap-3">
<button class="p-link inline-flex justify-content-center align-items-center text-white h-3rem w-3rem border-circle hover:bg-white-alpha-10 transition-all transition-duration-200"><i class="pi pi-home text-2xl"></i></button>
<button class="p-link inline-flex justify-content-center align-items-center text-white h-3rem w-3rem border-circle hover:bg-white-alpha-10 transition-all transition-duration-200"><i class="pi pi-user text-2xl"></i></button>
<button class="p-link inline-flex justify-content-center align-items-center text-white h-3rem w-3rem border-circle hover:bg-white-alpha-10 transition-all transition-duration-200"><i class="pi pi-search text-2xl"></i></button>
</div>
</template>
<template #end>
<div class="flex align-items-center gap-2">
<Avatar image="/images/avatar/amyelsner.png" shape="circle" />
<span class="font-bold text-bluegray-50">Amy Elsner</span>
</div>
</template>
</Toolbar>
Toolbar uses toolbar role to the root element, aria-orientation is not included as it defaults to "horizontal". Any valid attribute is passed to the root element so you may add additional properties like aria-labelledby to define the element if required.
Component does not include any interactive elements. Arbitrary content can be placed with templating and elements like buttons inside should follow the page tab sequence.