Sidebar Section Label
- Stable
- WCAG 2.2 evidence
- RTL
Heading text of a group of sidebar items. Presentational: renders in React Server
Components and reads the enclosing Sidebar's variant and collapsed state from CSS, not from React context. In the
collapsed rail the text is visually hidden and a 32 px divider is drawn instead. Accessibility: on its own it is plain text. Use SidebarSection label="…" to group items: the section is a group
named by this label, so screen readers announce the grouping that the label shows visually (WCAG 1.3.1). Consumer duty:
short, unique section names.
import { SidebarSectionLabel } from "@nexera-ui/react";- 4
- examples
- 2
- props
- 2
- live controls
- 1
- platform
- 3
- WCAG criteria
- 0
- blocks use it
Try every prop. Copy the code.
Change the props and the code updates. Check light and dark, LTR and RTL, and phone width.
import { SidebarSectionLabel } from "@nexera-ui/react";
<SidebarSectionLabel />Examples 3
The same examples as Storybook, rendered live. Open Code to copy one.
In section
Usual use through SidebarSection, which makes a group named by the label. Expanded and collapsed: in the rail the label becomes a divider and stays the group's name.
import { Sidebar, SidebarItem, SidebarSection } from "@nexera-ui/react";
import { LuChartColumn, LuTarget } from "react-icons/lu";
export function InSection() {
return (
<div className="flex flex-wrap items-start gap-4">
{(["brand", "light"] as const).flatMap((variant) =>
[false, true].map((isCollapsed) => (
<Sidebar
key={`${variant}${String(isCollapsed)}`}
variant={variant}
isCollapsed={isCollapsed}
isCollapsible={false}
aria-label={`${variant} ${isCollapsed ? "rail" : "sidebar"}`}
className="h-auto"
>
<SidebarSection label="Insights">
<SidebarItem href="#reports" icon={<LuChartColumn />} label="Reports" />
<SidebarItem href="#performance" icon={<LuTarget />} label="Performance" />
</SidebarSection>
</Sidebar>
)),
)}
</div>
);
}
Long label
Long section names wrap.
import { SidebarSectionLabel } from "@nexera-ui/react";
<SidebarSectionLabel label="Reports and analytics for line managers" />;
Right to left
Right to left.
import { SidebarSectionLabel } from "@nexera-ui/react";
<SidebarSectionLabel label="Workspace" />;
Props 2
Press "Try it" on a card to load that prop into the playground.
2 props shown
label*NexeraReactNodeSection name, a short noun such as "Reports". It wraps instead of truncating.
variantNexera"brand" | "light"Colour scheme. When omitted the label follows the enclosing Sidebar (Brand outside one).
* Required. React Aria props shown are the ones most apps use; the component accepts the rest of its React Aria props too.
Accessible by default.
Built on React Aria, and covered by the WCAG 2.2 evidence generated on every build.
WCAG 2.2 evidence
2 direct · 1 supporting- 1.3.1Info and RelationshipsLevel A · tested directly
- 1.4.12Text SpacingLevel AA · supporting test
- 4.1.2Name, Role, ValueLevel A · tested directly
Fits any width.
Nexera components respond to the space they are given. Drag the corner of the frame, or pick a width.
Styling hooks
Pass className to add Tailwind classes (merged last). State is exposed as data attributes, so you can style it with variants like data-pressed:.
<SidebarSectionLabel className="shadow-sm" />Used in blocks
No block uses SidebarSectionLabel yet.
Related components
- BreadcrumbShows where the current page sits in the hierarchy and links back to each level.
- BreadcrumbItemOne level of a `Breadcrumb` trail; use it only inside `Breadcrumb`.
- CursorPagerA previous and next pair for data without stable page numbers, such as an activity log or a cursor API.
- FABThe main action of a mobile screen: a floating button with a `nav/active-bg` fill and a large shadow.
- FeedStatusThe status line at the bottom of an infinite feed or a lazy list: "Loading more", "You have reached the end" or "Could not load more" with a retry action.
- JumpToPageA small "Go to page [48] of 120" control for long paged lists.
- NavigationBarThe bottom bar of a mobile layout: a named `nav` landmark with a list of three to five `NavItem`s.
- NavItemOne destination or action of a `NavigationBar`.