Shell
Frames an application with navigation, a title bar and a content area.
When to use
- Give related screens shared navigation and global actions.
Examples
Navigation rail
Loading the example
<k:Shell brand="Kor" title="Warehouse" selectedKey="inventory">
<k:items><k:NavItem key="inventory" text="Inventory" icon="boxes"/></k:items>
<k:content><k:Text text="Inventory overview"/></k:content>
</k:Shell>Switch work areas
Loading the example
<k:Shell brand="Kor" title="{/title}" selectedKey="orders" navigate=".onNavigate">
<k:items>
<k:NavItem key="orders" text="Orders" icon="list" count="4"/>
<k:NavItem key="receipts" text="Receipts" icon="truck"/>
</k:items>
<k:content><k:Text text="{/detail}"/></k:content>
</k:Shell>sap.ui.define(["sap/ui/core/mvc/Controller", "kor/ui/Toast"], (Controller, Toast) => Controller.extend("sample.ShellAreas", {
onNavigate(event) {
const orders = event.getParameter("key") === "orders";
const model = this.getView().getModel();
model.setProperty("/title", orders ? "Orders" : "Receipts");
model.setProperty("/detail", orders ? "Four orders are ready to pick." : "Two deliveries arrive today.");
Toast.show(model.getProperty("/title"));
}
}));API
Properties
| Name | Type | Default | Description |
|---|---|---|---|
brand | string | Product name | |
title | string | Top bar title | |
selectedKey | string | Key of the selected navigation entry | |
collapsed | boolean | false | Whether navigation is reduced to icons |
Aggregations
| Name | Type | Description |
|---|---|---|
items | NavItem[] | Navigation entries |
actions | sap.ui.core.Control[] | Top bar actions |
footer | sap.ui.core.Control[] | Content below the navigation entries |
content | sap.ui.core.Control[] | Main content |
Events
| Name | Type | Description |
|---|---|---|
navigate | key: string | A navigation entry was selected |
NavItem
A navigation entry in the application shell.
Properties
| Name | Type | Default | Description |
|---|---|---|---|
key | string | Navigation key | |
text | string | Menu text | |
icon | string | Icon name | |
group | string | Section heading | |
count | string | Count shown at the trailing edge |