App bar & Button App bar
App bar Examples
Copy-ready examples for App_bar + Button_appbar.
Mobile (controlled selection)
App_bar does not manage selection; keep the selected destination in your own state and pass isSelected to the item.
• Button_appbar uses a roving tab index pattern: set exactly one item as isSelected so it is focusable via Tab.
Live preview
Mobile app bar (controlled)
import { useState } from "react";
import App_bar from "@/_components/app_bar/App_bar";
import Button_appbar from "@/_components/app_bar/button_appbar/Button_appbar";
export default function Example() {
const [selected, setSelected] = useState<"home" | "search" | "profile">("home");
return (
<App_bar typeOfAppBar="mobile" ariaLabel="Primary navigation">
<Button_appbar
mode="mobile"
iconName="Home"
label="Home"
isSelected={selected === "home"}
onClick={() => setSelected("home")}
/>
<Button_appbar
mode="mobile"
iconName="Search"
label="Search"
isSelected={selected === "search"}
onClick={() => setSelected("search")}
/>
<Button_appbar
mode="mobile"
iconName="Person"
label="Profile"
isSelected={selected === "profile"}
onClick={() => setSelected("profile")}
/>
</App_bar>
);
}Mobile (counter + dot badge)
Use showInfo + baseNumber/baseLimit for a counter, or showInfo + notQuantity for a dot.
Live preview
Badges (counter + dot)
import { useState } from "react";
import App_bar from "@/_components/app_bar/App_bar";
import Button_appbar from "@/_components/app_bar/button_appbar/Button_appbar";
export default function Example() {
const [selected, setSelected] = useState<"home" | "inbox" | "alerts">("home");
return (
<App_bar typeOfAppBar="mobile" ariaLabel="Primary navigation">
<Button_appbar
mode="mobile"
iconName="Home"
label="Home"
isSelected={selected === "home"}
onClick={() => setSelected("home")}
/>
<Button_appbar
mode="mobile"
iconName="Inbox"
label="Inbox"
showInfo
baseNumber={12}
baseLimit={99}
isSelected={selected === "inbox"}
onClick={() => setSelected("inbox")}
/>
<Button_appbar
mode="mobile"
iconName="Notifications"
label="Alerts"
showInfo
notQuantity
variant="info"
isSelected={selected === "alerts"}
onClick={() => setSelected("alerts")}
/>
</App_bar>
);
}Fullscreen (horizontal layout)
In full mode, Button_appbar renders a horizontal layout and wraps the entire item with the pill.
Live preview
Full app bar + capped counter
import { useState } from "react";
import App_bar from "@/_components/app_bar/App_bar";
import Button_appbar from "@/_components/app_bar/button_appbar/Button_appbar";
export default function Example() {
const [selected, setSelected] = useState<"home" | "notifications" | "settings">("home");
return (
<App_bar typeOfAppBar="full" ariaLabel="Primary navigation">
<Button_appbar
mode="full"
iconName="Home"
label="Home"
isSelected={selected === "home"}
onClick={() => setSelected("home")}
/>
<Button_appbar
mode="full"
iconName="Notifications"
label="Notifications"
showInfo
baseNumber={128}
baseLimit={99}
variant="secondary"
isSelected={selected === "notifications"}
onClick={() => setSelected("notifications")}
/>
<Button_appbar
mode="full"
iconName="Settings"
label="Settings"
isSelected={selected === "settings"}
onClick={() => setSelected("settings")}
/>
</App_bar>
);
}Disabled item
Use isDisabled to prevent interaction and apply disabled + aria-disabled.
Live preview
Disabled destination
import { useState } from "react";
import App_bar from "@/_components/app_bar/App_bar";
import Button_appbar from "@/_components/app_bar/button_appbar/Button_appbar";
export default function Example() {
const [selected, setSelected] = useState<"home" | "reports">("home");
return (
<App_bar typeOfAppBar="full" ariaLabel="Primary navigation">
<Button_appbar
mode="full"
iconName="Home"
label="Home"
isSelected={selected === "home"}
onClick={() => setSelected("home")}
/>
<Button_appbar
mode="full"
iconName="Assessment"
label="Reports"
isDisabled
isSelected={selected === "reports"}
onClick={() => setSelected("reports")}
/>
</App_bar>
);
}App_bar with custom items (no Button_appbar)
App_bar is intentionally minimal; you can render any destination controls as children.
Custom item markup
import App_bar from "@/_components/app_bar/App_bar";
export default function Example() {
return (
<App_bar typeOfAppBar="mobile" ariaLabel="Primary navigation">
<button className="cssnt-appbar__item" type="button">
Home
</button>
<button className="cssnt-appbar__item" type="button">
Search
</button>
<button className="cssnt-appbar__item" type="button">
Profile
</button>
</App_bar>
);
}On this page
App bar Props
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
| typeOfAppBar | "mobile" | "full" | No | "mobile" | Layout variant of the app bar. |
| ariaLabel | string | No | "App bar" | aria-label applied to the root <nav>. |
| children | React.ReactNode | Yes | — | Destination items rendered inside the app bar list (buttons/links, usually Button_appbar). |
Components