Skip to content
MarkasUI
Type to search

    Guide

    MarkasUI

    Form

    Feedback

    Overlay

    Navigation

    Data

    Sections

    Animations

    Backgrounds

    Buttons

    Templates

    Pages

    Bottom Navigation

    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
    @php
        $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'],
            ['value' => 'cards', 'label' => 'Cards', 'icon' => 'M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zM3 10h18M7 15h3'],
            ['value' => 'profile', 'label' => 'Profile', 'icon' => 'M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0'],
        ];
        $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'],
        ];
    @endphp
    
    <div class="relative mx-auto h-[560px] w-full max-w-[360px] overflow-hidden rounded-[2.5rem] border border-line bg-surface">
        <div role="region" aria-label="Transactions" tabindex="0" class="h-full overflow-y-auto px-5 pt-8 pb-28 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary">
            <p class="text-sm text-muted">Total balance</p>
            <p class="mt-1 text-3xl font-semibold text-ink tabular-nums">Rp 12.480.000</p>
            <p class="mt-8 mb-1 text-sm font-medium text-ink">Recent transactions</p>
            <ul class="divide-y divide-line">
                @foreach ($transactions as [$name, $time, $amount])
                    <li class="flex items-center justify-between py-3">
                        <span class="grid">
                            <span class="text-sm font-medium text-ink">{{ $name }}</span>
                            <span class="text-xs text-muted">{{ $time }}</span>
                        </span>
                        <span class="text-sm font-medium text-ink tabular-nums">{{ $amount }}</span>
                    </li>
                @endforeach
            </ul>
        </div>
        <x-markas.bottom-navigation :items="$items" shrink-on-scroll class="absolute inset-x-4 bottom-4" />
    </div>
    import { BottomNavigation } from "@/components/markas/BottomNavigation";
    
    const 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" },
      {
        value: "cards",
        label: "Cards",
        icon: "M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zM3 10h18M7 15h3",
      },
      {
        value: "profile",
        label: "Profile",
        icon: "M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0",
      },
    ];
    
    const 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"],
    ];
    
    export default function BottomNavigationExample() {
      return (
        <div className="relative mx-auto h-[560px] w-full max-w-[360px] overflow-hidden rounded-[2.5rem] border border-line bg-surface">
          <div
            role="region"
            aria-label="Transactions"
            tabIndex={0}
            className="h-full overflow-y-auto px-5 pt-8 pb-28 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary"
          >
            <p className="text-sm text-muted">Total balance</p>
            <p className="mt-1 text-3xl font-semibold text-ink tabular-nums">
              Rp 12.480.000
            </p>
            <p className="mt-8 mb-1 text-sm font-medium text-ink">
              Recent transactions
            </p>
            <ul className="divide-y divide-line">
              {transactions.map(([name, time, amount]) => (
                <li key={name} className="flex items-center justify-between py-3">
                  <span className="grid">
                    <span className="text-sm font-medium text-ink">{name}</span>
                    <span className="text-xs text-muted">{time}</span>
                  </span>
                  <span className="text-sm font-medium text-ink tabular-nums">
                    {amount}
                  </span>
                </li>
              ))}
            </ul>
          </div>
          <BottomNavigation
            items={items}
            shrinkOnScroll
            className="absolute inset-x-4 bottom-4"
          />
        </div>
      );
    }
    <script setup lang="ts">
    import BottomNavigation from "@/components/markas/BottomNavigation.vue";
    
    const 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" },
      {
        value: "cards",
        label: "Cards",
        icon: "M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zM3 10h18M7 15h3",
      },
      {
        value: "profile",
        label: "Profile",
        icon: "M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0",
      },
    ];
    
    const 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"],
    ];
    </script>
    
    <template>
      <div
        class="relative mx-auto h-[560px] w-full max-w-[360px] overflow-hidden rounded-[2.5rem] border border-line bg-surface"
      >
        <div
          role="region"
          aria-label="Transactions"
          tabindex="0"
          class="h-full overflow-y-auto px-5 pt-8 pb-28 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary"
        >
          <p class="text-sm text-muted">Total balance</p>
          <p class="mt-1 text-3xl font-semibold text-ink tabular-nums">
            Rp 12.480.000
          </p>
          <p class="mt-8 mb-1 text-sm font-medium text-ink">Recent transactions</p>
          <ul class="divide-y divide-line">
            <li
              v-for="[name, time, amount] in transactions"
              :key="name"
              class="flex items-center justify-between py-3"
            >
              <span class="grid">
                <span class="text-sm font-medium text-ink">{{ name }}</span>
                <span class="text-xs text-muted">{{ time }}</span>
              </span>
              <span class="text-sm font-medium text-ink tabular-nums">{{
                amount
              }}</span>
            </li>
          </ul>
        </div>
        <BottomNavigation
          :items="items"
          shrink-on-scroll
          class="absolute inset-x-4 bottom-4"
        />
      </div>
    </template>
    <script lang="ts">
      import BottomNavigation from "$lib/components/markas/BottomNavigation.svelte";
    
      const 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",
        },
        {
          value: "cards",
          label: "Cards",
          icon: "M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zM3 10h18M7 15h3",
        },
        {
          value: "profile",
          label: "Profile",
          icon: "M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0",
        },
      ];
    
      const 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"],
      ];
    </script>
    
    <div
      class="relative mx-auto h-[560px] w-full max-w-[360px] overflow-hidden rounded-[2.5rem] border border-line bg-surface"
    >
      <!-- svelte-ignore a11y_no_noninteractive_tabindex -->
      <div
        role="region"
        aria-label="Transactions"
        tabindex="0"
        class="h-full overflow-y-auto px-5 pt-8 pb-28 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary"
      >
        <p class="text-sm text-muted">Total balance</p>
        <p class="mt-1 text-3xl font-semibold text-ink tabular-nums">
          Rp 12.480.000
        </p>
        <p class="mt-8 mb-1 text-sm font-medium text-ink">Recent transactions</p>
        <ul class="divide-y divide-line">
          {#each transactions as [name, time, amount] (name)}
            <li class="flex items-center justify-between py-3">
              <span class="grid">
                <span class="text-sm font-medium text-ink">{name}</span>
                <span class="text-xs text-muted">{time}</span>
              </span>
              <span class="text-sm font-medium text-ink tabular-nums">{amount}</span
              >
            </li>
          {/each}
        </ul>
      </div>
      <BottomNavigation
        {items}
        shrinkOnScroll
        class="absolute inset-x-4 bottom-4"
      />
    </div>
    ---
    import BottomNavigation from "@/components/markas/BottomNavigation.astro";
    
    const 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" },
      {
        value: "cards",
        label: "Cards",
        icon: "M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zM3 10h18M7 15h3",
      },
      {
        value: "profile",
        label: "Profile",
        icon: "M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0",
      },
    ];
    
    const 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"],
    ];
    ---
    
    <div
      class="relative mx-auto h-[560px] w-full max-w-[360px] overflow-hidden rounded-[2.5rem] border border-line bg-surface"
    >
      <div
        role="region"
        aria-label="Transactions"
        tabindex="0"
        class="h-full overflow-y-auto px-5 pt-8 pb-28 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary"
      >
        <p class="text-sm text-muted">Total balance</p>
        <p class="mt-1 text-3xl font-semibold text-ink tabular-nums">Rp 12.480.000</p>
        <p class="mt-8 mb-1 text-sm font-medium text-ink">Recent transactions</p>
        <ul class="divide-y divide-line">
          {
            transactions.map(([name, time, amount]) => (
              <li class="flex items-center justify-between py-3">
                <span class="grid">
                  <span class="text-sm font-medium text-ink">{name}</span>
                  <span class="text-xs text-muted">{time}</span>
                </span>
                <span class="text-sm font-medium text-ink tabular-nums">{amount}</span>
              </li>
            ))
          }
        </ul>
      </div>
      <BottomNavigation items={items} shrinkOnScroll class="absolute inset-x-4 bottom-4" />
    </div>
    import { Component } from "@angular/core";
    import { BottomNavigation } from "./markas/bottom-navigation.component";
    
    @Component({
      selector: "markas-example",
      imports: [BottomNavigation],
      template: `
        <div
          class="relative mx-auto h-[560px] w-full max-w-[360px] overflow-hidden rounded-[2.5rem] border border-line bg-surface"
        >
          <div
            role="region"
            aria-label="Transactions"
            tabindex="0"
            class="h-full overflow-y-auto px-5 pt-8 pb-28 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary"
          >
            <p class="text-sm text-muted">Total balance</p>
            <p class="mt-1 text-3xl font-semibold text-ink tabular-nums">
              Rp 12.480.000
            </p>
            <p class="mt-8 mb-1 text-sm font-medium text-ink">
              Recent transactions
            </p>
            <ul class="divide-y divide-line">
              @for (row of transactions; track row[0]) {
                <li class="flex items-center justify-between py-3">
                  <span class="grid">
                    <span class="text-sm font-medium text-ink">{{ row[0] }}</span>
                    <span class="text-xs text-muted">{{ row[1] }}</span>
                  </span>
                  <span class="text-sm font-medium text-ink tabular-nums">{{
                    row[2]
                  }}</span>
                </li>
              }
            </ul>
          </div>
          <markas-bottom-navigation
            [items]="items"
            shrinkOnScroll
            class="absolute inset-x-4 bottom-4"
          />
        </div>
      `,
    })
    export default class BottomNavigationExample {
      protected readonly 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",
        },
        {
          value: "cards",
          label: "Cards",
          icon: "M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zM3 10h18M7 15h3",
        },
        {
          value: "profile",
          label: "Profile",
          icon: "M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0",
        },
      ];
    
      protected readonly 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"],
      ];
    }

    Examples

    With an action button

    Moments

    Moments

    Moments

    Moments

    Moments

    Badges

    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-navigation

    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

    NameTypeDefaultDescription
    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-modelstring-Controlled selected item in React (with onValueChange) and Vue (v-model).
    defaultValuestringfirst itemItem 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.
    shrinkOnScrollbooleanfalseCollapse 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:actionReactNode | 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.
    navLabelstringMainAccessible name of the nav element.
    actionLabelstringCreateAccessible name of the action button.
    badgeLabelstring{count} newHidden text read after an item with a badge. {count} is replaced by the badge.
    bind:valuestring-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-actionCustomEvent-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.