Use UI Shell components for navigation and headers
mainThe UI Shell is a set of components designed to manage application navigation, header bars, and side navigation. It includes components for creating headers (CvHeader), global actions (CvHeaderGlobalAction), side navigation (CvSideNav), and content areas (CvContent).
Common patterns include:
- Header with Right Panels: Using the
header-globalandright-panelsslots inCvHeaderto host user profiles, notifications, and app switchers. - Header with Side Nav: Using the
left-panelsslot inCvHeaderto host aCvSideNav. - Rail Navigation: Configuring
CvSideNavwith therailprop to create a slim, icon-only navigation bar.
<cv-header aria-label="Carbon header">
<template v-slot:header-global>
<cv-header-global-action aria-controls="user-panel" label="User">
<user-avatar20 />
</cv-header-global-action>
</template>
<template v-slot:right-panels>
<cv-header-panel id="user-panel">
<!-- Panel content -->
</cv-header-panel>
</template>
</cv-header>
<cv-content>
<h1>Main Content</h1>
</cv-content>