Skip to content

Dashboard

Download .md

The dashboard frame is the second place where every Sosialoka product looks like one family (Alternative A). The menu, search and account sit in the same place in every product, so people who use more than one product never have to look for them.

  • Use it for every signed-in page of a web app.
  • Put lists, details and forms inside it. Don’t build a second header or a second sidebar.
DoKeep header actions to icons, each named by a tooltip, with the avatar last.
Don'tDon't fill the header with text buttons; they push the search aside and crowd small screens.
123456
  1. 1Sidebar with the product logo
  2. 2Header card, floating over a blur
  3. 3Search: opens the command palette
  4. 4Language code dropdown, then icon actions with tooltips
  5. 5Avatar and account menu, always last
  6. 6Content on background
  • Sidebar: 16rem on the white sidebar surface, with the product logo on top. The active item uses sidebar-accent and has aria-current="page".
  • Header card: one card, 56px tall (h-14 rounded-lg border-border bg-card shadow-md), that stays at the top while the page scrolls under a blur. It holds the search, the icon actions and the avatar, as the Cover Clearance header does.
  • Search: fills the card’s left side without a box of its own and opens the command palette. ⌘K or Ctrl+K opens it too.
  • Actions: the language as an outlined pill with its code, then 36px ghost icon buttons in muted-foreground, each named by a tooltip.
  • Account: the avatar, always last, opens the account menu.
  • Content: the page, on background.
  • One search: the card and ⌘K open the same palette. The block listens for ⌘K once per page, so it never opens a second palette over a search card from Command.
  • Menu: use five to seven items with icons. Settings go last. A product with more pages follows Navigation menu.
  • Actions: the language first, then at most three icon actions in this order: mode, help, notifications. Build the icon actions with DashboardIconButton, whose label becomes its tooltip and name.
  • Mode: the icon shows the current mode (sun or moon); the tooltip says what a click does, such as “Mode gelap”.
  • Language: DashboardLanguageSelect, as in Lokasign: an outlined dropdown trigger with the current code, “ID” or “EN”, in mono and a chevron. It opens a menu of languages with the current one marked. It is a pill (rounded-full), the one pill in the header, and stays a menu so more languages can join.
  • Notifications: badge shows the unread count; leave it out at zero. The bell opens the panel from Notifications.
  • Account menu: show the name and one detail line, then the actions. “Keluar” goes last as a destructive item.
  • Small screens: below md the sidebar becomes a sheet that opens from the menu button.
  • Preview frames: collapsible="none" keeps the sidebar in the page flow, such as inside a frame on a docs page.
React Vue Flutter Type Default Use
nav nav ShadButton.ghost list pages, parents or sections none The menu. For sections, sub menus and counts, see Navigation menu.
logo #logo slot widget element none The product logo at the top of the sidebar.
account account ShadAvatar { name, initials, detail?, menu } none The avatar and its menu. A menu item can set onSelect and destructive.
actions #actions slot ShadButton.outline and ShadIconButton.ghost in a ShadTooltip elements none Actions between the search and the avatar: DashboardLanguageSelect (value, options, onValueChange, label; Vue v-model), then DashboardIconButton (label, badge?, the icon as its child).
search search ShadInput in a ShadCard { groups: { heading, items }[] } none What the palette lists. An item runs its onSelect.
collapsible collapsible none offcanvas, icon, none offcanvas How the sidebar collapses.
labels labels Text { search, empty, account, menu } English Text for the search card, the palette and screen readers. The example passes Indonesian.
children default slot Expanded child element none The page content.
import { useState } from "react"
import { BarChart3Icon, BellIcon, DiscIcon, FileTextIcon, HomeIcon, MoonIcon, SettingsIcon, SunIcon } from "lucide-react"
import { DashboardIconButton, DashboardLanguageSelect, DashboardShell } from "@/components/blocks/dashboard-shell"
import { Card, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
const nav = [
{ title: "Dasbor", href: "#", icon: HomeIcon, active: true },
{ title: "Rilis", href: "#rilis", icon: DiscIcon },
{ title: "Royalti", href: "#royalti", icon: BarChart3Icon },
{ title: "Dokumen", href: "#dokumen", icon: FileTextIcon },
{ title: "Pengaturan", href: "#pengaturan", icon: SettingsIcon },
]
const stats = [
{ label: "Rilis aktif", value: "24" },
{ label: "Streaming bulan ini", value: "182.430" },
{ label: "Royalti bulan ini", value: "Rp4.812.500,00" },
]
export default function DashboardShellDemo() {
// Start from the mode the page is in, so the icon shows it.
const [dark, setDark] = useState(() => typeof document !== "undefined" && document.documentElement.dataset.theme === "dark")
const [language, setLanguage] = useState("id")
const toggleMode = () => {
setDark(!dark)
document.documentElement.dataset.theme = dark ? "light" : "dark"
}
return (
<DashboardShell
nav={nav}
actions={
<>
<DashboardLanguageSelect
label="Bahasa"
value={language}
onValueChange={setLanguage}
options={[
{ code: "id", label: "Bahasa Indonesia" },
{ code: "en", label: "English" },
]}
/>
<DashboardIconButton label={dark ? "Mode terang" : "Mode gelap"} onClick={toggleMode}>
{dark ? <MoonIcon /> : <SunIcon />}
</DashboardIconButton>
<DashboardIconButton label="Notifikasi" badge={3}>
<BellIcon />
</DashboardIconButton>
</>
}
labels={{ search: "Cari rilis, artis, atau dokumen", empty: "Tidak ada yang cocok.", account: "Akun {name}", menu: "Buka menu" }}
logo={
<span className="flex items-center gap-2 font-semibold">
<span className="size-7 rounded-md bg-primary" />
Produkmu
</span>
}
account={{
name: "Raka Pratama",
initials: "RP",
detail: "raka@contoh.id",
menu: [{ label: "Profil" }, { label: "Pengaturan akun" }, { label: "Keluar", destructive: true }],
}}
search={{
groups: [
{ heading: "Rilis", items: [{ label: "Senja di Kota" }, { label: "Kaset Pertama" }] },
{ heading: "Menu", items: nav.map((item) => ({ label: item.title })) },
],
}}
>
<h1 className="text-2xl font-semibold">Dasbor</h1>
<p className="mt-1 text-sm text-muted-foreground">Ringkasan katalogmu minggu ini.</p>
<div className="mt-6 grid gap-4 sm:grid-cols-3">
{stats.map((stat) => (
<Card key={stat.label}>
<CardHeader>
<CardDescription>{stat.label}</CardDescription>
<CardTitle className="text-2xl tabular-nums">{stat.value}</CardTitle>
</CardHeader>
</Card>
))}
</div>
</DashboardShell>
)
}
Terminal window
npx shadcn@latest add https://design.sosialoka.tech/r/react/dashboard-shell.json

The block lands in components/blocks/ and installs the Sosialoka Sidebar, Command, Dropdown Menu and Avatar with it.

Flutter has no blocks. The Flutter code builds the same frame from widgets: a sidebar column, the header card with the search, the icon actions and the avatar, and the content. On phones, move the menu into a sheet.

  • The active menu item has aria-current="page".
  • The search is a button, and its name is the search text. The ⌘K hint is shown beside it.
  • Each icon action is named by its label, and a count is read with it, such as “Notifikasi (3)”.
  • The avatar button is named “Akun” followed by the account name.