Lewati ke konten
MarkasUI
Ketik untuk mencari

    Panduan

    MarkasUI

    Form

    Feedback

    Overlay

    Navigasi

    Data

    Section

    Animasi

    Latar

    Tombol

    Template

    Halaman

    Navbar

    Header situs dengan brand, link, menu dropdown, pill hover yang meluncur, area aksi, dan menu seluler dengan grup yang bisa dibuka.

    @php
        $logo = [
            ['fill' => 'fill-ink/15', 'points' => '354,578 1256,138 1171,430 268,868'],
            ['fill' => 'fill-ink/55', 'points' => '553,443 1455,3 1370,295 467,733'],
            ['fill' => 'fill-success/35', 'points' => '421,762 1325,318 1240,611 336,1050'],
            ['fill' => 'fill-ink/30', 'points' => '265,1073 1169,629 1084,922 180,1362'],
            ['fill' => 'fill-ink/80', 'points' => '93,965 997,521 912,814 8,1253'],
            ['fill' => 'fill-success', 'points' => '347,1135 1251,691 1166,984 262,1424'],
        ];
        $links = [
            ['label' => 'Docs', 'href' => '/docs', 'active' => true],
            [
                'label' => 'Components',
                'children' => [
                    [
                        'label' => 'Forms',
                        'href' => '/components/forms',
                        'description' => 'Input, select, checkbox, and more',
                        'icon' => 'M3 7h18v10H3zM7 12h.01M11 12h6',
                    ],
                    [
                        'label' => 'Overlays',
                        'href' => '/components/overlays',
                        'description' => 'Modal, drawer, popover, toast',
                        'icon' => 'M8 8h12v12H8zM4 16V4h12',
                    ],
                    [
                        'label' => 'Navigation',
                        'href' => '/components/navigation',
                        'description' => 'Navbar, sidebar, tabs, menus',
                        'icon' => 'M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zm4-13-2 6-6 2 2-6z',
                    ],
                    [
                        'label' => 'Data display',
                        'href' => '/components/data',
                        'description' => 'Table, card, badge, avatar',
                        'icon' => 'M3 3v18h18M7 15l4-4 3 3 5-6',
                    ],
                    [
                        'label' => 'Feedback',
                        'href' => '/components/feedback',
                        'description' => 'Alert, progress, skeleton',
                        'icon' => 'M12 9v4m0 4h.01M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z',
                    ],
                    [
                        'label' => 'Effects',
                        'href' => '/components/effects',
                        'description' => 'Aurora, beams, and grid patterns',
                        'icon' => 'M12 3v4M12 17v4M3 12h4M17 12h4M6 6l2.5 2.5M15.5 15.5 18 18M6 18l2.5-2.5M15.5 8.5 18 6',
                    ],
                ],
            ],
            [
                'label' => 'Resources',
                'children' => [
                    [
                        'label' => 'Templates',
                        'href' => '/templates',
                        'description' => 'Full pages built from components',
                        'icon' => 'M3 4h18v6H3zM3 14h8v6H3zm12 0h6v6h-6z',
                    ],
                    [
                        'label' => 'Changelog',
                        'href' => '/changelog',
                        'description' => 'What shipped this week',
                        'icon' => 'M12 7v5l3 2M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z',
                    ],
                    [
                        'label' => 'Community',
                        'href' => '/community',
                        'description' => 'Ask and share on GitHub',
                        'icon' => 'M17 20v-2a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v2M10 10a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm11 10v-2a4 4 0 0 0-3-3.9M16 2.1a4 4 0 0 1 0 7.8',
                    ],
                ],
            ],
            ['label' => 'Pricing', 'href' => '/pricing'],
        ];
        $brand = 'flex items-center gap-2 rounded-md';
        $logoClass = 'size-6';
        $github = 'inline-flex size-9 items-center justify-center rounded-md text-muted transition-colors duration-150 ease-out hover:bg-subtle hover:text-ink';
        $icon = 'size-5';
    @endphp
    
    <x-markas.navbar :links="$links">
        <x-slot:brand>
            <a href="/" class="{{ $brand }}">
                <svg class="{{ $logoClass }}" viewBox="0 0 1464 1430" aria-hidden="true">
                    @foreach ($logo as $shape)
                        <polygon class="{{ $shape['fill'] }}" points="{{ $shape['points'] }}" />
                    @endforeach
                </svg>
                <span>MarkasUI</span>
            </a>
        </x-slot:brand>
        <x-slot:actions>
            <a href="https://github.com" aria-label="GitHub" class="{{ $github }}">
                <svg class="{{ $icon }}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.1-1.3-.3-2.5-1-3.5.3-1.2.3-2.4 0-3.5 0 0-1 0-3 1.5a13.4 13.4 0 0 0-8 0C6 2 5 2 5 2c-.3 1.2-.3 2.4 0 3.5A5.4 5.4 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.4.5-.7 1-.9 1.7-.2.6-.2 1.2-.1 1.8v4M9 18c-4.5 2-5-2-7-2" /></svg>
            </a>
            <x-markas.button size="sm">Get started</x-markas.button>
        </x-slot:actions>
    </x-markas.navbar>
    import { Button } from "@/components/markas/Button";
    import { Navbar } from "@/components/markas/Navbar";
    
    const logo = [
      { fill: "fill-ink/15", points: "354,578 1256,138 1171,430 268,868" },
      { fill: "fill-ink/55", points: "553,443 1455,3 1370,295 467,733" },
      { fill: "fill-success/35", points: "421,762 1325,318 1240,611 336,1050" },
      { fill: "fill-ink/30", points: "265,1073 1169,629 1084,922 180,1362" },
      { fill: "fill-ink/80", points: "93,965 997,521 912,814 8,1253" },
      { fill: "fill-success", points: "347,1135 1251,691 1166,984 262,1424" },
    ];
    
    const links = [
      { label: "Docs", href: "/docs", active: true },
      {
        label: "Components",
        children: [
          {
            label: "Forms",
            href: "/components/forms",
            description: "Input, select, checkbox, and more",
            icon: "M3 7h18v10H3zM7 12h.01M11 12h6",
          },
          {
            label: "Overlays",
            href: "/components/overlays",
            description: "Modal, drawer, popover, toast",
            icon: "M8 8h12v12H8zM4 16V4h12",
          },
          {
            label: "Navigation",
            href: "/components/navigation",
            description: "Navbar, sidebar, tabs, menus",
            icon: "M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zm4-13-2 6-6 2 2-6z",
          },
          {
            label: "Data display",
            href: "/components/data",
            description: "Table, card, badge, avatar",
            icon: "M3 3v18h18M7 15l4-4 3 3 5-6",
          },
          {
            label: "Feedback",
            href: "/components/feedback",
            description: "Alert, progress, skeleton",
            icon: "M12 9v4m0 4h.01M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",
          },
          {
            label: "Effects",
            href: "/components/effects",
            description: "Aurora, beams, and grid patterns",
            icon: "M12 3v4M12 17v4M3 12h4M17 12h4M6 6l2.5 2.5M15.5 15.5 18 18M6 18l2.5-2.5M15.5 8.5 18 6",
          },
        ],
      },
      {
        label: "Resources",
        children: [
          {
            label: "Templates",
            href: "/templates",
            description: "Full pages built from components",
            icon: "M3 4h18v6H3zM3 14h8v6H3zm12 0h6v6h-6z",
          },
          {
            label: "Changelog",
            href: "/changelog",
            description: "What shipped this week",
            icon: "M12 7v5l3 2M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z",
          },
          {
            label: "Community",
            href: "/community",
            description: "Ask and share on GitHub",
            icon: "M17 20v-2a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v2M10 10a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm11 10v-2a4 4 0 0 0-3-3.9M16 2.1a4 4 0 0 1 0 7.8",
          },
        ],
      },
      { label: "Pricing", href: "/pricing" },
    ];
    
    const brand = "flex items-center gap-2 rounded-md";
    const logoClass = "size-6";
    const github =
      "inline-flex size-9 items-center justify-center rounded-md text-muted transition-colors duration-150 ease-out hover:bg-subtle hover:text-ink";
    const icon = "size-5";
    
    export default function NavbarExample() {
      return (
        <Navbar
          links={links}
          brand={
            <a href="/" className={brand}>
              <svg className={logoClass} viewBox="0 0 1464 1430" aria-hidden="true">
                {logo.map((shape) => (
                  <polygon
                    key={shape.points}
                    className={shape.fill}
                    points={shape.points}
                  />
                ))}
              </svg>
              <span>MarkasUI</span>
            </a>
          }
          actions={
            <>
              <a href="https://github.com" aria-label="GitHub" className={github}>
                <svg
                  className={icon}
                  viewBox="0 0 24 24"
                  fill="none"
                  stroke="currentColor"
                  strokeWidth="1.5"
                  strokeLinecap="round"
                  strokeLinejoin="round"
                  aria-hidden="true"
                >
                  <path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.1-1.3-.3-2.5-1-3.5.3-1.2.3-2.4 0-3.5 0 0-1 0-3 1.5a13.4 13.4 0 0 0-8 0C6 2 5 2 5 2c-.3 1.2-.3 2.4 0 3.5A5.4 5.4 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.4.5-.7 1-.9 1.7-.2.6-.2 1.2-.1 1.8v4M9 18c-4.5 2-5-2-7-2" />
                </svg>
              </a>
              <Button size="sm">Get started</Button>
            </>
          }
        />
      );
    }
    <script setup lang="ts">
    import Button from "@/components/markas/Button.vue";
    import Navbar from "@/components/markas/Navbar.vue";
    
    const logo = [
      { fill: "fill-ink/15", points: "354,578 1256,138 1171,430 268,868" },
      { fill: "fill-ink/55", points: "553,443 1455,3 1370,295 467,733" },
      { fill: "fill-success/35", points: "421,762 1325,318 1240,611 336,1050" },
      { fill: "fill-ink/30", points: "265,1073 1169,629 1084,922 180,1362" },
      { fill: "fill-ink/80", points: "93,965 997,521 912,814 8,1253" },
      { fill: "fill-success", points: "347,1135 1251,691 1166,984 262,1424" },
    ];
    
    const links = [
      { label: "Docs", href: "/docs", active: true },
      {
        label: "Components",
        children: [
          {
            label: "Forms",
            href: "/components/forms",
            description: "Input, select, checkbox, and more",
            icon: "M3 7h18v10H3zM7 12h.01M11 12h6",
          },
          {
            label: "Overlays",
            href: "/components/overlays",
            description: "Modal, drawer, popover, toast",
            icon: "M8 8h12v12H8zM4 16V4h12",
          },
          {
            label: "Navigation",
            href: "/components/navigation",
            description: "Navbar, sidebar, tabs, menus",
            icon: "M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zm4-13-2 6-6 2 2-6z",
          },
          {
            label: "Data display",
            href: "/components/data",
            description: "Table, card, badge, avatar",
            icon: "M3 3v18h18M7 15l4-4 3 3 5-6",
          },
          {
            label: "Feedback",
            href: "/components/feedback",
            description: "Alert, progress, skeleton",
            icon: "M12 9v4m0 4h.01M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",
          },
          {
            label: "Effects",
            href: "/components/effects",
            description: "Aurora, beams, and grid patterns",
            icon: "M12 3v4M12 17v4M3 12h4M17 12h4M6 6l2.5 2.5M15.5 15.5 18 18M6 18l2.5-2.5M15.5 8.5 18 6",
          },
        ],
      },
      {
        label: "Resources",
        children: [
          {
            label: "Templates",
            href: "/templates",
            description: "Full pages built from components",
            icon: "M3 4h18v6H3zM3 14h8v6H3zm12 0h6v6h-6z",
          },
          {
            label: "Changelog",
            href: "/changelog",
            description: "What shipped this week",
            icon: "M12 7v5l3 2M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z",
          },
          {
            label: "Community",
            href: "/community",
            description: "Ask and share on GitHub",
            icon: "M17 20v-2a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v2M10 10a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm11 10v-2a4 4 0 0 0-3-3.9M16 2.1a4 4 0 0 1 0 7.8",
          },
        ],
      },
      { label: "Pricing", href: "/pricing" },
    ];
    
    const brand = "flex items-center gap-2 rounded-md";
    const logoClass = "size-6";
    const github =
      "inline-flex size-9 items-center justify-center rounded-md text-muted transition-colors duration-150 ease-out hover:bg-subtle hover:text-ink";
    const icon = "size-5";
    </script>
    
    <template>
      <Navbar :links="links">
        <template #brand>
          <a href="/" :class="brand">
            <svg :class="logoClass" viewBox="0 0 1464 1430" aria-hidden="true">
              <polygon
                v-for="shape in logo"
                :key="shape.points"
                :class="shape.fill"
                :points="shape.points"
              />
            </svg>
            <span>MarkasUI</span>
          </a>
        </template>
        <template #actions>
          <a href="https://github.com" aria-label="GitHub" :class="github">
            <svg
              :class="icon"
              viewBox="0 0 24 24"
              fill="none"
              stroke="currentColor"
              stroke-width="1.5"
              stroke-linecap="round"
              stroke-linejoin="round"
              aria-hidden="true"
            >
              <path
                d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.1-1.3-.3-2.5-1-3.5.3-1.2.3-2.4 0-3.5 0 0-1 0-3 1.5a13.4 13.4 0 0 0-8 0C6 2 5 2 5 2c-.3 1.2-.3 2.4 0 3.5A5.4 5.4 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.4.5-.7 1-.9 1.7-.2.6-.2 1.2-.1 1.8v4M9 18c-4.5 2-5-2-7-2"
              />
            </svg>
          </a>
          <Button size="sm">Get started</Button>
        </template>
      </Navbar>
    </template>
    <script lang="ts">
      import Button from "$lib/components/markas/Button.svelte";
      import Navbar from "$lib/components/markas/Navbar.svelte";
    
      const logo = [
        { fill: "fill-ink/15", points: "354,578 1256,138 1171,430 268,868" },
        { fill: "fill-ink/55", points: "553,443 1455,3 1370,295 467,733" },
        { fill: "fill-success/35", points: "421,762 1325,318 1240,611 336,1050" },
        { fill: "fill-ink/30", points: "265,1073 1169,629 1084,922 180,1362" },
        { fill: "fill-ink/80", points: "93,965 997,521 912,814 8,1253" },
        { fill: "fill-success", points: "347,1135 1251,691 1166,984 262,1424" },
      ];
    
      const links = [
        { label: "Docs", href: "/docs", active: true },
        {
          label: "Components",
          children: [
            {
              label: "Forms",
              href: "/components/forms",
              description: "Input, select, checkbox, and more",
              icon: "M3 7h18v10H3zM7 12h.01M11 12h6",
            },
            {
              label: "Overlays",
              href: "/components/overlays",
              description: "Modal, drawer, popover, toast",
              icon: "M8 8h12v12H8zM4 16V4h12",
            },
            {
              label: "Navigation",
              href: "/components/navigation",
              description: "Navbar, sidebar, tabs, menus",
              icon: "M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zm4-13-2 6-6 2 2-6z",
            },
            {
              label: "Data display",
              href: "/components/data",
              description: "Table, card, badge, avatar",
              icon: "M3 3v18h18M7 15l4-4 3 3 5-6",
            },
            {
              label: "Feedback",
              href: "/components/feedback",
              description: "Alert, progress, skeleton",
              icon: "M12 9v4m0 4h.01M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",
            },
            {
              label: "Effects",
              href: "/components/effects",
              description: "Aurora, beams, and grid patterns",
              icon: "M12 3v4M12 17v4M3 12h4M17 12h4M6 6l2.5 2.5M15.5 15.5 18 18M6 18l2.5-2.5M15.5 8.5 18 6",
            },
          ],
        },
        {
          label: "Resources",
          children: [
            {
              label: "Templates",
              href: "/templates",
              description: "Full pages built from components",
              icon: "M3 4h18v6H3zM3 14h8v6H3zm12 0h6v6h-6z",
            },
            {
              label: "Changelog",
              href: "/changelog",
              description: "What shipped this week",
              icon: "M12 7v5l3 2M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z",
            },
            {
              label: "Community",
              href: "/community",
              description: "Ask and share on GitHub",
              icon: "M17 20v-2a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v2M10 10a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm11 10v-2a4 4 0 0 0-3-3.9M16 2.1a4 4 0 0 1 0 7.8",
            },
          ],
        },
        { label: "Pricing", href: "/pricing" },
      ];
    
      const brandClass = "flex items-center gap-2 rounded-md";
      const logoClass = "size-6";
      const github =
        "inline-flex size-9 items-center justify-center rounded-md text-muted transition-colors duration-150 ease-out hover:bg-subtle hover:text-ink";
      const icon = "size-5";
    </script>
    
    <Navbar {links}>
      {#snippet brand()}
        <a href="/" class={brandClass}>
          <svg class={logoClass} viewBox="0 0 1464 1430" aria-hidden="true">
            {#each logo as shape (shape.points)}
              <polygon class={shape.fill} points={shape.points} />
            {/each}
          </svg>
          <span>MarkasUI</span>
        </a>
      {/snippet}
      {#snippet actions()}
        <a href="https://github.com" aria-label="GitHub" class={github}>
          <svg
            class={icon}
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="1.5"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
          >
            <path
              d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.1-1.3-.3-2.5-1-3.5.3-1.2.3-2.4 0-3.5 0 0-1 0-3 1.5a13.4 13.4 0 0 0-8 0C6 2 5 2 5 2c-.3 1.2-.3 2.4 0 3.5A5.4 5.4 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.4.5-.7 1-.9 1.7-.2.6-.2 1.2-.1 1.8v4M9 18c-4.5 2-5-2-7-2"
            />
          </svg>
        </a>
        <Button size="sm">Get started</Button>
      {/snippet}
    </Navbar>
    ---
    import Button from "@/components/markas/Button.astro";
    import Navbar from "@/components/markas/Navbar.astro";
    
    const logo = [
      { fill: "fill-ink/15", points: "354,578 1256,138 1171,430 268,868" },
      { fill: "fill-ink/55", points: "553,443 1455,3 1370,295 467,733" },
      { fill: "fill-success/35", points: "421,762 1325,318 1240,611 336,1050" },
      { fill: "fill-ink/30", points: "265,1073 1169,629 1084,922 180,1362" },
      { fill: "fill-ink/80", points: "93,965 997,521 912,814 8,1253" },
      { fill: "fill-success", points: "347,1135 1251,691 1166,984 262,1424" },
    ];
    
    const links = [
      { label: "Docs", href: "/docs", active: true },
      {
        label: "Components",
        children: [
          {
            label: "Forms",
            href: "/components/forms",
            description: "Input, select, checkbox, and more",
            icon: "M3 7h18v10H3zM7 12h.01M11 12h6",
          },
          {
            label: "Overlays",
            href: "/components/overlays",
            description: "Modal, drawer, popover, toast",
            icon: "M8 8h12v12H8zM4 16V4h12",
          },
          {
            label: "Navigation",
            href: "/components/navigation",
            description: "Navbar, sidebar, tabs, menus",
            icon: "M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zm4-13-2 6-6 2 2-6z",
          },
          {
            label: "Data display",
            href: "/components/data",
            description: "Table, card, badge, avatar",
            icon: "M3 3v18h18M7 15l4-4 3 3 5-6",
          },
          {
            label: "Feedback",
            href: "/components/feedback",
            description: "Alert, progress, skeleton",
            icon: "M12 9v4m0 4h.01M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",
          },
          {
            label: "Effects",
            href: "/components/effects",
            description: "Aurora, beams, and grid patterns",
            icon: "M12 3v4M12 17v4M3 12h4M17 12h4M6 6l2.5 2.5M15.5 15.5 18 18M6 18l2.5-2.5M15.5 8.5 18 6",
          },
        ],
      },
      {
        label: "Resources",
        children: [
          {
            label: "Templates",
            href: "/templates",
            description: "Full pages built from components",
            icon: "M3 4h18v6H3zM3 14h8v6H3zm12 0h6v6h-6z",
          },
          {
            label: "Changelog",
            href: "/changelog",
            description: "What shipped this week",
            icon: "M12 7v5l3 2M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z",
          },
          {
            label: "Community",
            href: "/community",
            description: "Ask and share on GitHub",
            icon: "M17 20v-2a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v2M10 10a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm11 10v-2a4 4 0 0 0-3-3.9M16 2.1a4 4 0 0 1 0 7.8",
          },
        ],
      },
      { label: "Pricing", href: "/pricing" },
    ];
    
    const brand = "flex items-center gap-2 rounded-md";
    const logoClass = "size-6";
    const github =
      "inline-flex size-9 items-center justify-center rounded-md text-muted transition-colors duration-150 ease-out hover:bg-subtle hover:text-ink";
    const icon = "size-5";
    ---
    
    <Navbar links={links}>
      <a slot="brand" href="/" class={brand}>
        <svg class={logoClass} viewBox="0 0 1464 1430" aria-hidden="true">
          {logo.map((shape) => <polygon class={shape.fill} points={shape.points} />)}
        </svg>
        <span>MarkasUI</span>
      </a>
      <Fragment slot="actions">
        <a href="https://github.com" aria-label="GitHub" class={github}>
          <svg
            class={icon}
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="1.5"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
          >
            <path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.1-1.3-.3-2.5-1-3.5.3-1.2.3-2.4 0-3.5 0 0-1 0-3 1.5a13.4 13.4 0 0 0-8 0C6 2 5 2 5 2c-.3 1.2-.3 2.4 0 3.5A5.4 5.4 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.4.5-.7 1-.9 1.7-.2.6-.2 1.2-.1 1.8v4M9 18c-4.5 2-5-2-7-2"></path>
          </svg>
        </a>
        <Button size="sm">Get started</Button>
      </Fragment>
    </Navbar>
    import { Component } from "@angular/core";
    import { Button } from "./markas/button.component";
    import {
      Navbar,
      type NavbarLink,
    } from "./markas/navbar.component";
    
    const logo = [
      { fill: "fill-ink/15", points: "354,578 1256,138 1171,430 268,868" },
      { fill: "fill-ink/55", points: "553,443 1455,3 1370,295 467,733" },
      { fill: "fill-success/35", points: "421,762 1325,318 1240,611 336,1050" },
      { fill: "fill-ink/30", points: "265,1073 1169,629 1084,922 180,1362" },
      { fill: "fill-ink/80", points: "93,965 997,521 912,814 8,1253" },
      { fill: "fill-success", points: "347,1135 1251,691 1166,984 262,1424" },
    ];
    
    const links: NavbarLink[] = [
      { label: "Docs", href: "/docs", active: true },
      {
        label: "Components",
        children: [
          {
            label: "Forms",
            href: "/components/forms",
            description: "Input, select, checkbox, and more",
            icon: "M3 7h18v10H3zM7 12h.01M11 12h6",
          },
          {
            label: "Overlays",
            href: "/components/overlays",
            description: "Modal, drawer, popover, toast",
            icon: "M8 8h12v12H8zM4 16V4h12",
          },
          {
            label: "Navigation",
            href: "/components/navigation",
            description: "Navbar, sidebar, tabs, menus",
            icon: "M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zm4-13-2 6-6 2 2-6z",
          },
          {
            label: "Data display",
            href: "/components/data",
            description: "Table, card, badge, avatar",
            icon: "M3 3v18h18M7 15l4-4 3 3 5-6",
          },
          {
            label: "Feedback",
            href: "/components/feedback",
            description: "Alert, progress, skeleton",
            icon: "M12 9v4m0 4h.01M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",
          },
          {
            label: "Effects",
            href: "/components/effects",
            description: "Aurora, beams, and grid patterns",
            icon: "M12 3v4M12 17v4M3 12h4M17 12h4M6 6l2.5 2.5M15.5 15.5 18 18M6 18l2.5-2.5M15.5 8.5 18 6",
          },
        ],
      },
      {
        label: "Resources",
        children: [
          {
            label: "Templates",
            href: "/templates",
            description: "Full pages built from components",
            icon: "M3 4h18v6H3zM3 14h8v6H3zm12 0h6v6h-6z",
          },
          {
            label: "Changelog",
            href: "/changelog",
            description: "What shipped this week",
            icon: "M12 7v5l3 2M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z",
          },
          {
            label: "Community",
            href: "/community",
            description: "Ask and share on GitHub",
            icon: "M17 20v-2a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v2M10 10a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm11 10v-2a4 4 0 0 0-3-3.9M16 2.1a4 4 0 0 1 0 7.8",
          },
        ],
      },
      { label: "Pricing", href: "/pricing" },
    ];
    
    @Component({
      selector: "markas-example",
      imports: [Button, Navbar],
      template: `
        <header markas-navbar [links]="links">
          <a brand href="/" [class]="brand">
            <svg
              [attr.class]="logoClass"
              viewBox="0 0 1464 1430"
              aria-hidden="true"
            >
              @for (shape of logo; track shape.points) {
                <polygon [attr.class]="shape.fill" [attr.points]="shape.points" />
              }
            </svg>
            <span>MarkasUI</span>
          </a>
          <ng-container actions>
            <a href="https://github.com" aria-label="GitHub" [class]="github">
              <svg
                [attr.class]="icon"
                viewBox="0 0 24 24"
                fill="none"
                stroke="currentColor"
                stroke-width="1.5"
                stroke-linecap="round"
                stroke-linejoin="round"
                aria-hidden="true"
              >
                <path
                  d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.1-1.3-.3-2.5-1-3.5.3-1.2.3-2.4 0-3.5 0 0-1 0-3 1.5a13.4 13.4 0 0 0-8 0C6 2 5 2 5 2c-.3 1.2-.3 2.4 0 3.5A5.4 5.4 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.4.5-.7 1-.9 1.7-.2.6-.2 1.2-.1 1.8v4M9 18c-4.5 2-5-2-7-2"
                />
              </svg>
            </a>
            <button markas-button size="sm">Get started</button>
          </ng-container>
        </header>
      `,
    })
    export default class NavbarExample {
      protected readonly logo = logo;
      protected readonly links = links;
      protected readonly brand = "flex items-center gap-2 rounded-md";
      protected readonly logoClass = "size-6";
      protected readonly github =
        "inline-flex size-9 items-center justify-center rounded-md text-muted transition-colors duration-150 ease-out hover:bg-subtle hover:text-ink";
      protected readonly icon = "size-5";
    }

    Contoh

    Pil kaca mengambang

    Copy, paste, and ship it today

    A glass pill that floats over the page. The highlight slides to whatever you point at.

    Copy, paste, and ship it today

    A glass pill that floats over the page. The highlight slides to whatever you point at.

    Copy, paste, and ship it today

    A glass pill that floats over the page. The highlight slides to whatever you point at.

    Copy, paste, and ship it today

    A glass pill that floats over the page. The highlight slides to whatever you point at.

    Copy, paste, and ship it today

    A glass pill that floats over the page. The highlight slides to whatever you point at.

    Dengan bar pengumuman

    Pencarian perintah di tengah

    Dua tingkat dengan bar utilitas

    Mega menu dengan kartu sorotan

    MarkasUI

    Header dashboard

    Seluler dengan tab bawah

    Good morning, Rian

    What shipped this week

    • Navbar Eight new layouts New
    • Command Grouped results and hotkey Updated
    • Sidebar Collapsible icon rail Updated
    • Footer Newsletter and sitemap New
    • Theme toggle Six transition styles Updated

    Good morning, Rian

    What shipped this week

    • NavbarEight new layoutsNew
    • CommandGrouped results and hotkeyUpdated
    • SidebarCollapsible icon railUpdated
    • FooterNewsletter and sitemapNew
    • Theme toggleSix transition stylesUpdated

    Good morning, Rian

    What shipped this week

    • NavbarEight new layoutsNew
    • CommandGrouped results and hotkeyUpdated
    • SidebarCollapsible icon railUpdated
    • FooterNewsletter and sitemapNew
    • Theme toggleSix transition stylesUpdated

    Good morning, Rian

    What shipped this week

    • Navbar Eight new layouts New
    • Command Grouped results and hotkey Updated
    • Sidebar Collapsible icon rail Updated
    • Footer Newsletter and sitemap New
    • Theme toggle Six transition styles Updated

    Good morning, Rian

    What shipped this week

    • NavbarEight new layoutsNew
    • CommandGrouped results and hotkeyUpdated
    • SidebarCollapsible icon railUpdated
    • FooterNewsletter and sitemapNew
    • Theme toggleSix transition stylesUpdated

    Bening di atas hero, solid saat digulir

    MarkasUI 1.0 is out

    Interfaces that feel finished

    Scroll this page. The header starts clear over the hero and turns solid once content moves under it.

    Three frameworks

    Blade, React, and Vue share the same classes and variants.

    Native first

    Dialog, Popover API, and details before any extra script.

    Tokens only

    Fifteen colour tokens keep light and dark mode in step.

    MarkasUI 1.0 is out

    Interfaces that feel finished

    Scroll this page. The header starts clear over the hero and turns solid once content moves under it.

    Three frameworks

    Blade, React, and Vue share the same classes and variants.

    Native first

    Dialog, Popover API, and details before any extra script.

    Tokens only

    Fifteen colour tokens keep light and dark mode in step.

    MarkasUI 1.0 is out

    Interfaces that feel finished

    Scroll this page. The header starts clear over the hero and turns solid once content moves under it.

    Three frameworks

    Blade, React, and Vue share the same classes and variants.

    Native first

    Dialog, Popover API, and details before any extra script.

    Tokens only

    Fifteen colour tokens keep light and dark mode in step.

    MarkasUI 1.0 is out

    Interfaces that feel finished

    Scroll this page. The header starts clear over the hero and turns solid once content moves under it.

    Three frameworks

    Blade, React, and Vue share the same classes and variants.

    Native first

    Dialog, Popover API, and details before any extra script.

    Tokens only

    Fifteen colour tokens keep light and dark mode in step.

    MarkasUI 1.0 is out

    Interfaces that feel finished

    Scroll this page. The header starts clear over the hero and turns solid once content moves under it.

    Three frameworks

    Blade, React, and Vue share the same classes and variants.

    Native first

    Dialog, Popover API, and details before any extra script.

    Tokens only

    Fifteen colour tokens keep light and dark mode in step.

    Instalasi

    npx markasui@latest add navbar

    Pemakaian

    <x-markas.navbar
        nav-label="Utama"
        mobile-nav-label="Utama seluler"
        variant="blur"
        :sticky="true"
        :links="[
            ['label' => 'Beranda', 'href' => '/', 'active' => true],
            ['label' => 'Produk', 'children' => [
                [
                    'label' => 'Analitik',
                    'href' => '/analitik',
                    'description' => 'Pantau pemakaian secara langsung',
                    'icon' => 'M3 3v18h18M7 15l4-4 3 3 5-6',
                ],
                ['label' => 'Otomasi', 'href' => '/otomasi'],
            ]],
            ['label' => 'Harga', 'href' => '/harga'],
        ]"
    >
        <x-slot:brand>MarkasUI</x-slot:brand>
        <x-slot:actions>
            <x-markas.button size="sm">Masuk</x-markas.button>
        </x-slot:actions>
    </x-markas.navbar>

    Butuh Alpine.js untuk dropdown dan menu seluler.

    import { Button } from "@/components/markas/Button";
    import { Navbar } from "@/components/markas/Navbar";
    
    <Navbar
      variant="blur"
      sticky
      brand="MarkasUI"
      navLabel="Utama"
      mobileNavLabel="Utama seluler"
      links={[
        { label: "Beranda", href: "/", active: true },
        {
          label: "Produk",
          children: [
            {
              label: "Analitik",
              href: "/analitik",
              description: "Pantau pemakaian secara langsung",
              icon: "M3 3v18h18M7 15l4-4 3 3 5-6",
            },
            { label: "Otomasi", href: "/otomasi" },
          ],
        },
        { label: "Harga", href: "/harga" },
      ]}
      actions={<Button size="sm">Masuk</Button>}
    />;
    <script setup lang="ts">
    const links = [
      { label: "Beranda", href: "/", active: true },
      {
        label: "Produk",
        children: [
          {
            label: "Analitik",
            href: "/analitik",
            description: "Pantau pemakaian secara langsung",
            icon: "M3 3v18h18M7 15l4-4 3 3 5-6",
          },
          { label: "Otomasi", href: "/otomasi" },
        ],
      },
      { label: "Harga", href: "/harga" },
    ];
    </script>
    
    <template>
      <Navbar
        variant="blur"
        sticky
        nav-label="Utama"
        mobile-nav-label="Utama seluler"
        :links="links"
      >
        <template #brand>MarkasUI</template>
        <template #actions>
          <Button size="sm">Masuk</Button>
        </template>
      </Navbar>
    </template>
    <script lang="ts">
      import Button from "$lib/components/markas/Button.svelte";
      import Navbar from "$lib/components/markas/Navbar.svelte";
    
      const links = [
        { label: "Beranda", href: "/", active: true },
        {
          label: "Produk",
          children: [
            {
              label: "Analitik",
              href: "/analitik",
              description: "Pantau pemakaian secara langsung",
              icon: "M3 3v18h18M7 15l4-4 3 3 5-6",
            },
            { label: "Otomasi", href: "/otomasi" },
          ],
        },
        { label: "Harga", href: "/harga" },
      ];
    </script>
    
    <Navbar
      variant="blur"
      sticky
      navLabel="Utama"
      mobileNavLabel="Utama seluler"
      {links}
    >
      {#snippet brand()}MarkasUI{/snippet}
      {#snippet actions()}
        <Button size="sm">Masuk</Button>
      {/snippet}
    </Navbar>
    ---
    import Button from "@/components/markas/Button.astro";
    import Navbar from "@/components/markas/Navbar.astro";
    
    const links = [
      { label: "Beranda", href: "/", active: true },
      {
        label: "Produk",
        children: [
          {
            label: "Analitik",
            href: "/analitik",
            description: "Pantau pemakaian secara langsung",
            icon: "M3 3v18h18M7 15l4-4 3 3 5-6",
          },
          { label: "Otomasi", href: "/otomasi" },
        ],
      },
      { label: "Harga", href: "/harga" },
    ];
    ---
    
    <Navbar
      variant="blur"
      sticky
      navLabel="Utama"
      mobileNavLabel="Utama seluler"
      links={links}
    >
      <Fragment slot="brand">MarkasUI</Fragment>
      <Button slot="actions" size="sm">Masuk</Button>
    </Navbar>

    Satu script kecil yang dibundel menjalankan dropdown dan menu seluler semua navbar di halaman. Tetap jalan setelah view transition.

    import { Component } from "@angular/core";
    import { Button } from "./markas/button.component";
    import { Navbar, type NavbarLink } from "./markas/navbar.component";
    
    @Component({
      selector: "app-header",
      imports: [Button, Navbar],
      template: `
        <header
          markas-navbar
          variant="blur"
          sticky
          navLabel="Utama"
          mobileNavLabel="Utama seluler"
          [links]="links"
        >
          <ng-container brand>MarkasUI</ng-container>
          <button markas-button actions size="sm">Masuk</button>
        </header>
      `,
    })
    export class AppHeader {
      readonly links: NavbarLink[] = [
        { label: "Beranda", href: "/", active: true },
        {
          label: "Produk",
          children: [
            {
              label: "Analitik",
              href: "/analitik",
              description: "Pantau pemakaian secara langsung",
              icon: "M3 3v18h18M7 15l4-4 3 3 5-6",
            },
            { label: "Otomasi", href: "/otomasi" },
          ],
        },
        { label: "Harga", href: "/harga" },
      ];
    }

    Komponen dipasang di elemen header native (header[markas-navbar]), jadi atribut id, class, dan data-* tetap di header.

    • Link biasa dari versi sebelumnya tetap jalan. Tambahkan children pada item untuk menjadikannya dropdown; href item itu lalu diabaikan.
    • Panel dropdown memakai Popover API native, jadi tampil di top layer di atas konten lain dan tertutup saat klik di luar atau Escape. Panel dengan lebih dari tiga link mengalir ke kolom kedua.
    • variant: default memberi garis bawah tipis, floating berupa bar membulat dengan border dan bayangan halus, blur semi transparan dengan backdrop blur. Pasangkan blur dengan sticky di atas konten yang tergulir di bawah header.
    • Tata letak mengikuti lebar header lewat container query (@container dan @2xl:), bukan lebar layar. Menu desktop tampil saat header selebar 42rem atau lebih, di bawah itu muncul tombol menu dan dropdown menjadi grup yang bisa dibuka dan ditutup.
    • Label bawaan dalam bahasa Inggris: tombol “Menu”, nav “Main” dan “Main mobile”. Isi navLabel dan mobileNavLabel (Blade: nav-label, mobile-nav-label) untuk situs berbahasa Indonesia. menuLabel (Blade: menu-label) juga bisa diubah, walau “Menu” sudah cocok.

    Props

    NamaTipeDefaultKeterangan
    links{ label, href?, active?, children?: { label, href, description?, icon? }[] }[][]Menu utama. Link dengan active diberi aria-current=page. Item dengan children menjadi pemicu dropdown; icon adalah path SVG (d) untuk ikon garis 24px.
    brandslot / ReactNode-Logo atau nama situs di kiri.
    actionsslot / ReactNode-Area kanan, misalnya tombol Masuk.
    variant"default" | "floating" | "blur""default"default: garis bawah tipis. floating: bar membulat berborder dengan bayangan halus. blur: latar semi transparan dengan backdrop blur untuk konten yang tergulir di bawahnya.
    stickybooleanfalseHeader tetap di atas saat halaman digulir (floating menyisakan jarak kecil).
    menuLabelstringMenuLabel aksesibel tombol menu seluler. Default "Menu" sudah cocok untuk Bahasa Indonesia.
    navLabelstringMainLabel aksesibel nav desktop. Isi "Utama" untuk situs berbahasa Indonesia.
    mobileNavLabelstringMain mobileLabel aksesibel nav seluler. Isi "Utama seluler" untuk situs berbahasa Indonesia.

    Aksesibilitas

    • Tombol menu seluler memakai aria-expanded dan aria-controls yang menunjuk ke panel menu.
    • Escape menutup panel seluler dan fokus kembali ke tombol menu.
    • Menu desktop dan seluler masing-masing dibungkus nav dengan label berbeda (navLabel dan mobileNavLabel).
    • Tata letak mengikuti lebar header (container query), menu desktop tampil mulai lebar 42rem.
    • Dropdown mengikuti pola WAI-ARIA disclosure navigation: tombol dengan aria-expanded dan aria-controls membuka popover native. Klik, Enter, Spasi, dan ArrowDown membukanya, ArrowDown juga memfokuskan link pertama, Escape menutupnya dan mengembalikan fokus ke tombol.
    • Hover membuka dropdown setelah 120ms dan menutupnya 180ms setelah mouse pergi; sentuhan dan pena mengabaikan hover.
    • Di seluler, item dengan children menjadi grup details dan summary yang dibuka dengan Enter atau Spasi.
    • Animasi dimatikan dengan prefers-reduced-motion.

    Komponen terkait

    Komponen navigasi lain dengan class yang sama di setiap framework.