Skip to content

Mobile app

Download .md

The mobile app frame is the phone version of the Dashboard: the same places for the title, the search and the main destinations in every Sosialoka app, from Cover Clearance to My Loka Link.

  • Use it for every signed-in screen of a phone app, and for a web app on phones.
  • Put lists, details and forms inside it. Don’t build a second header or a second navigation.
  1. Top bar: 56px tall, with the screen title on the left and at most two icon buttons on the right, such as notifications. An optional search field sits under it.
  2. Content: the screen, on background, with room at the bottom so the last item is never hidden behind the bottom nav.
  3. Bottom nav: 3 to 5 destinations, each an icon above a label. The current one is in primary, without a pill behind it.
  • Top bar holds the title, two icon buttons and the search, nothing else. Greetings, summary cards, tabs and filters go in the content below it.
  • Home screen: the greeting, the featured card’s title and headline figures at the top may use font-brand; everything else stays in font-sans. See Brand moments.
  • Bottom nav: 3 to 5 destinations, labels always shown, targets at least 48px tall. Put Account last.
  • Sort and filter open a Drawer from the bottom, never a page.
  • Rows use Item; a status goes in a Badge on the row.
  • Safe areas: the top bar and the bottom nav keep clear of the notch and the home indicator (env(safe-area-inset-*)).
React Vue Flutter Type Default Use
title title Text text none The screen title.
nav nav a Row of icon and label buttons { title, href, icon, active? }[] none The bottom nav.
actions #actions slot ShadIconButton.ghost element none At most two icon buttons in the top bar.
search #search slot ShadInput element none The optional search under the title.
labels labels Semantics { nav } English The name of the bottom nav for screen readers, such as “Navigasi utama”.
children default slot Expanded child element none The screen content.
import { useId } from "react"
import { BarChart3Icon, BellIcon, DiscIcon, HomeIcon, SearchIcon, UserIcon } from "lucide-react"
import { MobileShell } from "@/components/blocks/mobile-shell"
import { Badge } from "@/components/ui/badge"
import { Button } from "@/components/ui/button"
import {
Drawer,
DrawerClose,
DrawerContent,
DrawerFooter,
DrawerHeader,
DrawerTitle,
DrawerTrigger,
} from "@/components/ui/drawer"
import { InputGroup, InputGroupAddon, InputGroupInput } from "@/components/ui/input-group"
import { Item, ItemContent, ItemDescription, ItemGroup, ItemTitle } from "@/components/ui/item"
import { Label } from "@/components/ui/label"
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"
const nav = [
{ title: "Beranda", href: "#", icon: HomeIcon },
{ title: "Rilis", href: "#rilis", icon: DiscIcon, active: true },
{ title: "Royalti", href: "#royalti", icon: BarChart3Icon },
{ title: "Notifikasi", href: "#notifikasi", icon: BellIcon },
{ title: "Akun", href: "#akun", icon: UserIcon },
]
const releases = [
{ title: "Senja di Kota", artist: "Rara Senandika", status: "success", label: "Terbit" },
{ title: "Kaset Pertama", artist: "Bima Laras", status: "warning", label: "Menunggu" },
{ title: "Pulang Sore", artist: "Nada Kirana", status: "info", label: "Dijadwalkan" },
{ title: "Hujan Bulan Juni", artist: "Arka Wening", status: "success", label: "Terbit" },
{ title: "Lampu Kota", artist: "Sinta Maharani", status: "destructive", label: "Ditolak" },
{ title: "Jalan Pulang", artist: "Raka Pratama", status: "success", label: "Terbit" },
] as const
export default function MobileShellDemo() {
const id = useId()
return (
<MobileShell
title="Rilis"
nav={nav}
labels={{ nav: "Navigasi utama" }}
actions={
<Button variant="ghost" size="icon-lg" className="size-11" aria-label="Notifikasi">
<BellIcon />
</Button>
}
search={
<InputGroup>
<InputGroupAddon>
<SearchIcon />
</InputGroupAddon>
<InputGroupInput type="search" aria-label="Cari rilis" placeholder="Cari judul atau artis" />
</InputGroup>
}
>
<div className="mb-3 flex items-center justify-between">
<p className="text-sm text-muted-foreground">6 rilis</p>
<Drawer>
<DrawerTrigger render={<Button variant="outline" size="sm" />}>Urutkan</DrawerTrigger>
<DrawerContent>
<DrawerHeader>
<DrawerTitle>Urutkan rilis</DrawerTitle>
</DrawerHeader>
<RadioGroup defaultValue="newest" aria-label="Urutan" className="px-4">
{[
["newest", "Terbaru"],
["oldest", "Terlama"],
["title", "Judul A–Z"],
].map(([value, label]) => (
<div key={value} className="flex items-center gap-3">
<RadioGroupItem value={value} id={`${id}-${value}`} />
<Label htmlFor={`${id}-${value}`}>{label}</Label>
</div>
))}
</RadioGroup>
<DrawerFooter>
<DrawerClose render={<Button />}>Terapkan</DrawerClose>
</DrawerFooter>
</DrawerContent>
</Drawer>
</div>
<ItemGroup className="gap-2">
{releases.map((r) => (
<Item key={r.title} variant="outline" render={<a href="#" />}>
<ItemContent>
<ItemTitle>{r.title}</ItemTitle>
<ItemDescription>{r.artist}</ItemDescription>
</ItemContent>
<Badge variant={r.status}>{r.label}</Badge>
</Item>
))}
</ItemGroup>
</MobileShell>
)
}
Terminal window
npx shadcn@latest add https://design.sosialoka.tech/r/react/mobile-shell.json

The block lands in components/blocks/. Install Item, Drawer, Badge, Input Group, Button, Label and Radio Group for the content shown here.

Flutter apps build the same frame from widgets: a Column with the top bar, an Expanded list of ShadItem, and a bottom row of icon and label buttons inside a SafeArea. A Material NavigationBar works too if it follows the same rules: labels always shown, the current item in primary, no pill indicator.

  • The bottom nav is a nav named “Main navigation” by default (“Navigasi utama” in the example); the current destination has aria-current="page".
  • Every destination shows its label, so it never relies on the icon alone.
  • Icon buttons in the top bar have a name, such as “Notifikasi”.
  • The bell opens the notifications page, not a popover: see Notifications.