Documentation / @zerotal/admin / index / Cluster
Abstract Class: Cluster
Defined in: admin/src/Cluster.ts:23
Cluster — a named section of the panel that owns a group of resources and pages, giving them a shared URL segment and a single sidebar entry.
A panel with thirty resources spread across three business areas is easier to navigate as three clusters than as one long list. Members declare which cluster they belong to; the panel does the rest:
export class ShopCluster extends Cluster { static override slug = "shop"; static override title = "Shop"; static override navigationIcon = "collection"; }
export class ProductResource extends Resource { static override cluster = ShopCluster; // → /admin/shop/products }
The cluster's own ability gates the whole section: deny it and every member
disappears from the sidebar and refuses its route, without each member having
to repeat the check.
Constructors
Constructor
new Cluster():
Cluster
Returns
Cluster
Properties
slug
staticslug:string
Defined in: admin/src/Cluster.ts:25
URL segment the cluster's members live under.
title
statictitle:string
Defined in: admin/src/Cluster.ts:27
Heading shown for the cluster in navigation and breadcrumbs.
navigationLabel?
staticoptionalnavigationLabel?:string
Defined in: admin/src/Cluster.ts:29
Sidebar label, when it should differ from the title.
navigationIcon
staticnavigationIcon:string="layout-grid"
Defined in: admin/src/Cluster.ts:31
Navigation icon key (see ui/icons.ts).
navigationGroup?
staticoptionalnavigationGroup?:string
Defined in: admin/src/Cluster.ts:33
Optional sidebar group the cluster itself sits in.
navigationSort
staticnavigationSort:number=0
Defined in: admin/src/Cluster.ts:35
Sort order within the sidebar (lower = higher).
ability?
staticoptionalability?:string
Defined in: admin/src/Cluster.ts:37
Ability gating the whole cluster, checked for the entry and every route.
Methods
getNavigationLabel()
staticgetNavigationLabel():string
Defined in: admin/src/Cluster.ts:39
Returns
string
url()
staticurl(base):string
Defined in: admin/src/Cluster.ts:44
The cluster's URL prefix under a panel base.
Parameters
base
string
Returns
string