Mobile app style bottom bar. A pill glides to the selected item, its label rises in, and the bar can shrink to icons while content scrolls.
Total balance
Rp 12.480.000
Recent transactions
- Kopi Kenangan Today, 08:12 -Rp 32.000
- Salary Today, 07:00 +Rp 9.500.000
- GoRide Yesterday, 18:40 -Rp 18.500
- Tokopedia Yesterday, 13:05 -Rp 245.000
- Electricity token 3 Nov, 20:15 -Rp 200.000
- Transfer from Rina 3 Nov, 09:30 +Rp 150.000
- Indomaret 2 Nov, 19:02 -Rp 67.800
- Netflix 1 Nov, 00:01 -Rp 54.000
- Freelance invoice 31 Oct, 16:45 +Rp 2.750.000
- Sate Khas Senayan 30 Oct, 20:10 -Rp 128.000
Total balance
Rp 12.480.000
Recent transactions
- Kopi KenanganToday, 08:12-Rp 32.000
- SalaryToday, 07:00+Rp 9.500.000
- GoRideYesterday, 18:40-Rp 18.500
- TokopediaYesterday, 13:05-Rp 245.000
- Electricity token3 Nov, 20:15-Rp 200.000
- Transfer from Rina3 Nov, 09:30+Rp 150.000
- Indomaret2 Nov, 19:02-Rp 67.800
- Netflix1 Nov, 00:01-Rp 54.000
- Freelance invoice31 Oct, 16:45+Rp 2.750.000
- Sate Khas Senayan30 Oct, 20:10-Rp 128.000
Total balance
Rp 12.480.000
Recent transactions
- Kopi KenanganToday, 08:12-Rp 32.000
- SalaryToday, 07:00+Rp 9.500.000
- GoRideYesterday, 18:40-Rp 18.500
- TokopediaYesterday, 13:05-Rp 245.000
- Electricity token3 Nov, 20:15-Rp 200.000
- Transfer from Rina3 Nov, 09:30+Rp 150.000
- Indomaret2 Nov, 19:02-Rp 67.800
- Netflix1 Nov, 00:01-Rp 54.000
- Freelance invoice31 Oct, 16:45+Rp 2.750.000
- Sate Khas Senayan30 Oct, 20:10-Rp 128.000
Total balance
Rp 12.480.000
Recent transactions
- Kopi Kenangan Today, 08:12 -Rp 32.000
- Salary Today, 07:00 +Rp 9.500.000
- GoRide Yesterday, 18:40 -Rp 18.500
- Tokopedia Yesterday, 13:05 -Rp 245.000
- Electricity token 3 Nov, 20:15 -Rp 200.000
- Transfer from Rina 3 Nov, 09:30 +Rp 150.000
- Indomaret 2 Nov, 19:02 -Rp 67.800
- Netflix 1 Nov, 00:01 -Rp 54.000
- Freelance invoice 31 Oct, 16:45 +Rp 2.750.000
- Sate Khas Senayan 30 Oct, 20:10 -Rp 128.000
Total balance
Rp 12.480.000
Recent transactions
- Kopi KenanganToday, 08:12-Rp 32.000
- SalaryToday, 07:00+Rp 9.500.000
- GoRideYesterday, 18:40-Rp 18.500
- TokopediaYesterday, 13:05-Rp 245.000
- Electricity token3 Nov, 20:15-Rp 200.000
- Transfer from Rina3 Nov, 09:30+Rp 150.000
- Indomaret2 Nov, 19:02-Rp 67.800
- Netflix1 Nov, 00:01-Rp 54.000
- Freelance invoice31 Oct, 16:45+Rp 2.750.000
- Sate Khas Senayan30 Oct, 20:10-Rp 128.000
Examples
With an action button
Moments
Moments
Moments
Moments
Moments
Badges
@php
$items = [
['value' => 'chats', 'label' => 'Chats', 'icon' => 'M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z', 'badge' => 3],
['value' => 'calls', 'label' => 'Calls', 'icon' => 'M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1 1 .4 1.9.7 2.8a2 2 0 0 1-.5 2.1L8 9.9a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.8.7a2 2 0 0 1 1.7 2z'],
['value' => 'updates', 'label' => 'Updates', 'icon' => 'M6 8a6 6 0 1 1 12 0c0 7 3 9 3 9H3s3-2 3-9M10.3 21a1.94 1.94 0 0 0 3.4 0', 'badge' => 12],
['value' => 'settings', 'label' => 'Settings', 'icon' => 'M4 6h10M18 6h2M4 12h4M12 12h8M4 18h12M20 18h0M16 4v4M10 10v4M18 16v4'],
];
@endphp
<div class="rounded-2xl bg-subtle p-6">
<x-markas.bottom-navigation :items="$items" default-value="updates" />
</div>Links
Orders
2 parcels on the way to Bandung
Orders
2 parcels on the way to Bandung
Orders
2 parcels on the way to Bandung
Orders
2 parcels on the way to Bandung
Orders
2 parcels on the way to Bandung
Installation
npx markasui@latest add bottom-navigationpnpm dlx markasui@latest add bottom-navigationyarn dlx markasui@latest add bottom-navigationbunx --bun markasui@latest add bottom-navigation- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Install the dependency:
npm install alpinejs - Copy the component source below to
resources/views/components/markas/bottom-navigation.blade.php.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/BottomNavigation.tsx.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/BottomNavigation.vue.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/lib/components/markas/BottomNavigation.svelte.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/BottomNavigation.astro.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/app/markas/bottom-navigation.component.ts.
Usage
<div class="relative h-dvh overflow-hidden">
<main class="h-full overflow-y-auto pb-28">...</main>
<x-markas.bottom-navigation
shrink-on-scroll
default-value="home"
action-label="New transfer"
class="absolute inset-x-4 bottom-4"
x-on:change="console.log($event.detail)"
:items="[
['value' => 'home', 'label' => 'Home', 'icon' => 'M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z'],
['value' => 'activity', 'label' => 'Activity', 'icon' => 'M3 3v18h18M7 15l4-4 3 3 5-6', 'badge' => 2],
['value' => 'profile', 'label' => 'Profile', 'href' => '/profile', 'icon' => 'M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0'],
]"
>
<x-slot:action>
<svg class="size-6" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="M12 5v14M5 12h14" /></svg>
</x-slot:action>
</x-markas.bottom-navigation>
</div>import { BottomNavigation } from "@/components/markas/BottomNavigation";
const [tab, setTab] = useState("home");
<BottomNavigation
items={items}
value={tab}
onValueChange={setTab}
shrinkOnScroll
action={<PlusIcon className="size-6" />}
actionLabel="New transfer"
onAction={openTransfer}
className="absolute inset-x-4 bottom-4"
/>;<script setup lang="ts">
import { ref } from "vue";
import BottomNavigation from "@/components/markas/BottomNavigation.vue";
const tab = ref("home");
</script>
<template>
<BottomNavigation
v-model="tab"
:items="items"
shrink-on-scroll
action-label="New transfer"
class="absolute inset-x-4 bottom-4"
@action="openTransfer"
>
<template #action><PlusIcon class="size-6" /></template>
</BottomNavigation>
</template><script lang="ts">
import BottomNavigation from "$lib/components/markas/BottomNavigation.svelte";
let tab = $state("home");
</script>
<BottomNavigation
{items}
bind:value={tab}
shrinkOnScroll
actionLabel="New transfer"
onaction={openTransfer}
class="absolute inset-x-4 bottom-4"
>
{#snippet action()}
<PlusIcon class="size-6" />
{/snippet}
</BottomNavigation>The action button renders only when the action snippet is given.
---
import BottomNavigation from "@/components/markas/BottomNavigation.astro";
---
<BottomNavigation
items={items}
defaultValue="home"
shrinkOnScroll
actionLabel="New transfer"
class="absolute inset-x-4 bottom-4"
>
<PlusIcon slot="action" class="size-6" />
</BottomNavigation>A small custom element moves the pill and shrinks the bar. It dispatches markas-change (the value as detail) and markas-action, both bubbling.
import { Component, signal } from "@angular/core";
import { BottomNavigation } from "./markas/bottom-navigation.component";
@Component({
selector: "app-wallet-nav",
imports: [BottomNavigation],
template: `
<markas-bottom-navigation
[items]="items"
[(value)]="tab"
shrinkOnScroll
actionLabel="New transfer"
(action)="openTransfer()"
class="absolute inset-x-4 bottom-4"
>
<svg action class="size-6" viewBox="0 0 24 24" aria-hidden="true">
<path d="M12 5v14M5 12h14" stroke="currentColor" />
</svg>
</markas-bottom-navigation>
`,
})
export class WalletNav {
items = [{ value: "home", label: "Home", icon: "M3 10.5 12 3l9 7.5V20H3z" }];
tab = signal("home");
openTransfer() {}
}An element with the action attribute fills the round action button.
- Place the bar inside the element that scrolls (or next to it, in the same parent). shrinkOnScroll listens to scrolling inside the bar’s parent element and on the page.
- Give the scrolling content bottom padding (about pb-28) so the last row is not hidden under the bar.
- The pill and labels are pure CSS driven by the selected index, so the first render already shows the right state on the server.
- Items with href stay real links. Pressing one still updates the pill for single page apps.
Props
| Name | Type | Default | Description |
|---|---|---|---|
items | { value: string; label: string; icon: string; href?: string; badge?: number | string }[] | [] | Destinations. icon is the d attribute of a 24x24 stroked SVG path. Items with href render as links, the rest as buttons. |
value / v-model | string | - | Controlled selected item in React (with onValueChange) and Vue (v-model). |
defaultValue | string | first item | Item selected on first render. |
onValueChange / x-on:change | (value: string) => void | - | Fires when an item is picked. Blade dispatches a change DOM event with the value as detail. |
shrinkOnScroll | boolean | false | Collapse to icons while the content around the bar (its parent element or the page) scrolls down, expand again on scroll up. |
action / #action / x-slot:action | ReactNode | slot | - | Icon for a round action button next to the bar. The button only renders when this is set. |
onAction / @action / x-on:action | () => void | - | Fires when the action button is pressed. |
navLabel | string | Main | Accessible name of the nav element. |
actionLabel | string | Create | Accessible name of the action button. |
badgeLabel | string | {count} new | Hidden text read after an item with a badge. {count} is replaced by the badge. |
bind:value | string | - | Svelte only. Two-way binding of the current item. Svelte also takes onValueChange, onaction, and an action snippet. |
[(value)] / (action) | model<string> / output<void> | - | Angular only. Current item with two-way binding, and the action button press. An element with the action attribute fills the button. |
markas-change / markas-action | CustomEvent | - | Astro only. Bubbling events from markas-bottom-navigation: the picked value as detail, and a press of the action button (slot="action"). |
Accessibility
- The bar is a nav landmark named by navLabel, with a list of links or buttons in tab order.
- The selected item has aria-current="page". Every label stays in the accessible name even while it is visually hidden.
- Badges are hidden from screen readers and read through badgeLabel instead.
- With reduced motion the pill and labels change without movement.
Related components
More markasui components with the same classes in every framework.
- Card StackLayered stack of cards. Swipe, arrow keys, or buttons throw the top card away and the next one rises. Loops, with a position indicator.
- Chat MessageMessage in an AI conversation. User bubbles on the right, assistant replies with an avatar, hover actions, a typing indicator, and optional token streaming.
- Currency InputMoney field that formats as you type (Rp 12.500.000), keeps the caret in place, and posts the plain number. Optional quick amount chips.
- DockmacOS style dock. Icons grow smoothly toward the pointer or focus, show a label above, mark open items with a dot, and bounce on launch.
- Drag ElementsArea of cards or stickers you can drag around with light momentum, kept inside its bounds. Arrow keys move a focused item, Escape puts it back.
- Dynamic IslandBlack pill inspired by the iPhone Dynamic Island. It morphs smoothly between idle, compact, and expanded states while its content crossfades.