Skip to content
MarkasUI
Type to search

    Guide

    MarkasUI

    Form

    Feedback

    Overlay

    Navigation

    Data

    Sections

    Animations

    Backgrounds

    Buttons

    Templates

    Pages

    Sidebar

    App sidebar with grouped links, a sliding active indicator, collapsible sub-items, an icon rail mode, and an off-canvas dialog on narrow layouts.

    MarkasUIPro workspace
    RS Rina Saputrarina@markasui.com

    Projects / Website redesign

    Sprint 14

    Open

    24

    Shipped

    18

    Up next

    Hero copy review
    Pricing page QA
    Footer links audit
    MarkasUIPro workspace
    RSRina Saputrarina@markasui.com

    Projects / Website redesign

    Sprint 14

    Open

    24

    Shipped

    18

    Up next

    Hero copy review
    Pricing page QA
    Footer links audit
    MarkasUIPro workspace
    RS Rina Saputrarina@markasui.com

    Projects / Website redesign

    Sprint 14

    Open

    24

    Shipped

    18

    Up next

    Hero copy review
    Pricing page QA
    Footer links audit
    MarkasUI Pro workspace
    RS Rina Saputra rina@markasui.com

    Projects / Website redesign

    Sprint 14

    Open

    24

    Shipped

    18

    Up next

    Hero copy review
    Pricing page QA
    Footer links audit
    MarkasUIPro workspace
    RSRina Saputrarina@markasui.com

    Projects / Website redesign

    Sprint 14

    Open

    24

    Shipped

    18

    Up next

    Hero copy review
    Pricing page QA
    Footer links audit
    <x-markas.sidebar :sections="[
        [
            'items' => [
                [
                    'label' => 'Home',
                    'href' => '/',
                    'icon' => 'M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6h-6v6H4a1 1 0 0 1-1-1z',
                ],
                [
                    'label' => 'Inbox',
                    'href' => '/inbox',
                    'icon' => 'M3 13h5l1.5 3h5l1.5-3h5M5 5h14l2 8v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-6z',
                    'badge' => 12,
                ],
            ],
        ],
        [
            'title' => 'Workspace',
            'items' => [
                [
                    'label' => 'Projects',
                    'icon' => 'M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z',
                    'children' => [
                        ['label' => 'Website redesign', 'href' => '/projects/website', 'active' => true],
                        ['label' => 'Mobile app', 'href' => '/projects/mobile'],
                        ['label' => 'Design system', 'href' => '/projects/design-system'],
                    ],
                ],
                [
                    'label' => 'Analytics',
                    'href' => '/analytics',
                    'icon' => 'M3 3v18h18M7 15l4-4 3 3 5-6',
                ],
            ],
        ],
        [
            'title' => 'Account',
            'items' => [
                [
                    'label' => 'Settings',
                    'href' => '/settings',
                    'icon' => 'M4 6h9m4 0h3M4 12h3m4 0h9M4 18h11m4 0h1M15 4v4M9 10v4M17 16v4',
                ],
            ],
        ],
    ]" breakpoint="sm" class="h-[540px] rounded-xl border border-line">
        <x-slot:header>
            <svg class="size-7 shrink-0" viewBox="0 0 1464 1430" aria-hidden="true"><polygon points="354,578 1256,138 1171,430 268,868" class="fill-ink/15" /><polygon points="553,443 1455,3 1370,295 467,733" class="fill-ink/55" /><polygon points="421,762 1325,318 1240,611 336,1050" class="fill-success/35" /><polygon points="265,1073 1169,629 1084,922 180,1362" class="fill-ink/25" /><polygon points="93,965 997,521 912,814 8,1253" class="fill-ink/75" /><polygon points="347,1135 1251,691 1166,984 262,1424" class="fill-success" /></svg>
            <div class="grid min-w-0 leading-tight"><span class="font-semibold text-ink">MarkasUI</span><span class="text-xs text-muted">Pro workspace</span></div>
        </x-slot:header>
        <x-slot:footer>
            <span class="relative grid size-8 shrink-0 place-items-center rounded-full bg-primary-soft text-xs font-semibold text-ink">RS<span aria-hidden="true" class="absolute -right-0.5 -bottom-0.5 size-2.5 rounded-full border-2 border-surface bg-success"></span></span>
            <span class="grid min-w-0 flex-1 leading-tight"><span class="truncate font-medium text-ink">Rina Saputra</span><span class="truncate text-xs text-muted">rina@markasui.com</span></span>
            <svg class="size-4 shrink-0 text-faint" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m8 9 4-4 4 4m0 6-4 4-4-4" /></svg>
        </x-slot:footer>
        <div class="flex min-w-0 flex-1 flex-col gap-4 p-5">
            <div class="grid gap-1">
                <p class="text-xs text-muted">Projects / Website redesign</p>
                <p class="text-lg font-semibold tracking-tight text-ink">Sprint 14</p>
            </div>
            <div class="grid grid-cols-2 gap-3">
                <div class="rounded-xl border border-line bg-surface p-3"><p class="text-xs text-muted">Open</p><p class="mt-1 text-xl font-semibold text-ink">24</p></div>
                <div class="rounded-xl border border-line bg-surface p-3"><p class="text-xs text-muted">Shipped</p><p class="mt-1 text-xl font-semibold text-ink">18</p></div>
            </div>
            <div class="grid content-start gap-3 rounded-xl border border-line bg-surface p-4">
                <p class="text-xs font-medium text-faint">Up next</p>
                @foreach ([['Hero copy review', 'bg-success'], ['Pricing page QA', 'bg-warning'], ['Footer links audit', 'bg-faint']] as [$label, $tone])
                    <div class="flex items-center gap-2.5"><span aria-hidden="true" class="size-2 shrink-0 rounded-full {{ $tone }}"></span><span class="truncate text-sm text-ink">{{ $label }}</span></div>
                @endforeach
            </div>
        </div>
    </x-markas.sidebar>
    import { Sidebar } from "@/components/markas/Sidebar";
    
    const mark = [
      { points: "354,578 1256,138 1171,430 268,868", className: "fill-ink/15" },
      { points: "553,443 1455,3 1370,295 467,733", className: "fill-ink/55" },
      {
        points: "421,762 1325,318 1240,611 336,1050",
        className: "fill-success/35",
      },
      { points: "265,1073 1169,629 1084,922 180,1362", className: "fill-ink/25" },
      { points: "93,965 997,521 912,814 8,1253", className: "fill-ink/75" },
      {
        points: "347,1135 1251,691 1166,984 262,1424",
        className: "fill-success",
      },
    ];
    
    const sections = [
      {
        items: [
          {
            label: "Home",
            href: "/",
            icon: "M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6h-6v6H4a1 1 0 0 1-1-1z",
          },
          {
            label: "Inbox",
            href: "/inbox",
            icon: "M3 13h5l1.5 3h5l1.5-3h5M5 5h14l2 8v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-6z",
            badge: 12,
          },
        ],
      },
      {
        title: "Workspace",
        items: [
          {
            label: "Projects",
            icon: "M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",
            children: [
              {
                label: "Website redesign",
                href: "/projects/website",
                active: true,
              },
              {
                label: "Mobile app",
                href: "/projects/mobile",
              },
              {
                label: "Design system",
                href: "/projects/design-system",
              },
            ],
          },
          {
            label: "Analytics",
            href: "/analytics",
            icon: "M3 3v18h18M7 15l4-4 3 3 5-6",
          },
        ],
      },
      {
        title: "Account",
        items: [
          {
            label: "Settings",
            href: "/settings",
            icon: "M4 6h9m4 0h3M4 12h3m4 0h9M4 18h11m4 0h1M15 4v4M9 10v4M17 16v4",
          },
        ],
      },
    ];
    
    const tasks = [
      { label: "Hero copy review", tone: "bg-success" },
      { label: "Pricing page QA", tone: "bg-warning" },
      { label: "Footer links audit", tone: "bg-faint" },
    ];
    
    export default function SidebarExample() {
      return (
        <Sidebar
          sections={sections}
          breakpoint="sm"
          className="h-[540px] rounded-xl border border-line"
          header={
            <>
              <svg
                className="size-7 shrink-0"
                viewBox="0 0 1464 1430"
                aria-hidden="true"
              >
                {mark.map((shape) => (
                  <polygon
                    key={shape.points}
                    points={shape.points}
                    className={shape.className}
                  />
                ))}
              </svg>
              <div className="grid min-w-0 leading-tight">
                <span className="font-semibold text-ink">MarkasUI</span>
                <span className="text-xs text-muted">Pro workspace</span>
              </div>
            </>
          }
          footer={
            <>
              <span className="relative grid size-8 shrink-0 place-items-center rounded-full bg-primary-soft text-xs font-semibold text-ink">
                RS
                <span
                  aria-hidden="true"
                  className="absolute -right-0.5 -bottom-0.5 size-2.5 rounded-full border-2 border-surface bg-success"
                ></span>
              </span>
              <span className="grid min-w-0 flex-1 leading-tight">
                <span className="truncate font-medium text-ink">Rina Saputra</span>
                <span className="truncate text-xs text-muted">
                  rina@markasui.com
                </span>
              </span>
              <svg
                className="size-4 shrink-0 text-faint"
                viewBox="0 0 24 24"
                fill="none"
                stroke="currentColor"
                strokeWidth="1.5"
                strokeLinecap="round"
                strokeLinejoin="round"
                aria-hidden="true"
              >
                <path d="m8 9 4-4 4 4m0 6-4 4-4-4" />
              </svg>
            </>
          }
        >
          <div className="flex min-w-0 flex-1 flex-col gap-4 p-5">
            <div className="grid gap-1">
              <p className="text-xs text-muted">Projects / Website redesign</p>
              <p className="text-lg font-semibold tracking-tight text-ink">
                Sprint 14
              </p>
            </div>
            <div className="grid grid-cols-2 gap-3">
              <div className="rounded-xl border border-line bg-surface p-3">
                <p className="text-xs text-muted">Open</p>
                <p className="mt-1 text-xl font-semibold text-ink">24</p>
              </div>
              <div className="rounded-xl border border-line bg-surface p-3">
                <p className="text-xs text-muted">Shipped</p>
                <p className="mt-1 text-xl font-semibold text-ink">18</p>
              </div>
            </div>
            <div className="grid content-start gap-3 rounded-xl border border-line bg-surface p-4">
              <p className="text-xs font-medium text-faint">Up next</p>
              {tasks.map((task) => (
                <div key={task.label} className="flex items-center gap-2.5">
                  <span
                    aria-hidden="true"
                    className={`size-2 shrink-0 rounded-full ${task.tone}`}
                  ></span>
                  <span className="truncate text-sm text-ink">{task.label}</span>
                </div>
              ))}
            </div>
          </div>
        </Sidebar>
      );
    }
    <script setup lang="ts">
    import Sidebar from "@/components/markas/Sidebar.vue";
    
    const mark = [
      { points: "354,578 1256,138 1171,430 268,868", className: "fill-ink/15" },
      { points: "553,443 1455,3 1370,295 467,733", className: "fill-ink/55" },
      {
        points: "421,762 1325,318 1240,611 336,1050",
        className: "fill-success/35",
      },
      { points: "265,1073 1169,629 1084,922 180,1362", className: "fill-ink/25" },
      { points: "93,965 997,521 912,814 8,1253", className: "fill-ink/75" },
      {
        points: "347,1135 1251,691 1166,984 262,1424",
        className: "fill-success",
      },
    ];
    
    const sections = [
      {
        items: [
          {
            label: "Home",
            href: "/",
            icon: "M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6h-6v6H4a1 1 0 0 1-1-1z",
          },
          {
            label: "Inbox",
            href: "/inbox",
            icon: "M3 13h5l1.5 3h5l1.5-3h5M5 5h14l2 8v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-6z",
            badge: 12,
          },
        ],
      },
      {
        title: "Workspace",
        items: [
          {
            label: "Projects",
            icon: "M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",
            children: [
              {
                label: "Website redesign",
                href: "/projects/website",
                active: true,
              },
              {
                label: "Mobile app",
                href: "/projects/mobile",
              },
              {
                label: "Design system",
                href: "/projects/design-system",
              },
            ],
          },
          {
            label: "Analytics",
            href: "/analytics",
            icon: "M3 3v18h18M7 15l4-4 3 3 5-6",
          },
        ],
      },
      {
        title: "Account",
        items: [
          {
            label: "Settings",
            href: "/settings",
            icon: "M4 6h9m4 0h3M4 12h3m4 0h9M4 18h11m4 0h1M15 4v4M9 10v4M17 16v4",
          },
        ],
      },
    ];
    
    const tasks = [
      { label: "Hero copy review", tone: "bg-success" },
      { label: "Pricing page QA", tone: "bg-warning" },
      { label: "Footer links audit", tone: "bg-faint" },
    ];
    </script>
    
    <template>
      <Sidebar
        :sections="sections"
        breakpoint="sm"
        class="h-[540px] rounded-xl border border-line"
      >
        <template #header>
          <svg class="size-7 shrink-0" viewBox="0 0 1464 1430" aria-hidden="true">
            <polygon
              v-for="shape in mark"
              :key="shape.points"
              :points="shape.points"
              :class="shape.className"
            />
          </svg>
          <div class="grid min-w-0 leading-tight">
            <span class="font-semibold text-ink">MarkasUI</span>
            <span class="text-xs text-muted">Pro workspace</span>
          </div>
        </template>
        <template #footer>
          <span
            class="relative grid size-8 shrink-0 place-items-center rounded-full bg-primary-soft text-xs font-semibold text-ink"
          >
            RS
            <span
              aria-hidden="true"
              class="absolute -right-0.5 -bottom-0.5 size-2.5 rounded-full border-2 border-surface bg-success"
            ></span>
          </span>
          <span class="grid min-w-0 flex-1 leading-tight">
            <span class="truncate font-medium text-ink">Rina Saputra</span>
            <span class="truncate text-xs text-muted">rina@markasui.com</span>
          </span>
          <svg
            class="size-4 shrink-0 text-faint"
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="1.5"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
          >
            <path d="m8 9 4-4 4 4m0 6-4 4-4-4" />
          </svg>
        </template>
        <div class="flex min-w-0 flex-1 flex-col gap-4 p-5">
          <div class="grid gap-1">
            <p class="text-xs text-muted">Projects / Website redesign</p>
            <p class="text-lg font-semibold tracking-tight text-ink">Sprint 14</p>
          </div>
          <div class="grid grid-cols-2 gap-3">
            <div class="rounded-xl border border-line bg-surface p-3">
              <p class="text-xs text-muted">Open</p>
              <p class="mt-1 text-xl font-semibold text-ink">24</p>
            </div>
            <div class="rounded-xl border border-line bg-surface p-3">
              <p class="text-xs text-muted">Shipped</p>
              <p class="mt-1 text-xl font-semibold text-ink">18</p>
            </div>
          </div>
          <div
            class="grid content-start gap-3 rounded-xl border border-line bg-surface p-4"
          >
            <p class="text-xs font-medium text-faint">Up next</p>
            <div
              v-for="task in tasks"
              :key="task.label"
              class="flex items-center gap-2.5"
            >
              <span
                aria-hidden="true"
                :class="`size-2 shrink-0 rounded-full ${task.tone}`"
              ></span>
              <span class="truncate text-sm text-ink">{{ task.label }}</span>
            </div>
          </div>
        </div>
      </Sidebar>
    </template>
    <script lang="ts">
      import Sidebar from "$lib/components/markas/Sidebar.svelte";
    
      const mark = [
        { points: "354,578 1256,138 1171,430 268,868", className: "fill-ink/15" },
        { points: "553,443 1455,3 1370,295 467,733", className: "fill-ink/55" },
        {
          points: "421,762 1325,318 1240,611 336,1050",
          className: "fill-success/35",
        },
        { points: "265,1073 1169,629 1084,922 180,1362", className: "fill-ink/25" },
        { points: "93,965 997,521 912,814 8,1253", className: "fill-ink/75" },
        {
          points: "347,1135 1251,691 1166,984 262,1424",
          className: "fill-success",
        },
      ];
    
      const sections = [
        {
          items: [
            {
              label: "Home",
              href: "/",
              icon: "M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6h-6v6H4a1 1 0 0 1-1-1z",
            },
            {
              label: "Inbox",
              href: "/inbox",
              icon: "M3 13h5l1.5 3h5l1.5-3h5M5 5h14l2 8v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-6z",
              badge: 12,
            },
          ],
        },
        {
          title: "Workspace",
          items: [
            {
              label: "Projects",
              icon: "M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",
              children: [
                {
                  label: "Website redesign",
                  href: "/projects/website",
                  active: true,
                },
                {
                  label: "Mobile app",
                  href: "/projects/mobile",
                },
                {
                  label: "Design system",
                  href: "/projects/design-system",
                },
              ],
            },
            {
              label: "Analytics",
              href: "/analytics",
              icon: "M3 3v18h18M7 15l4-4 3 3 5-6",
            },
          ],
        },
        {
          title: "Account",
          items: [
            {
              label: "Settings",
              href: "/settings",
              icon: "M4 6h9m4 0h3M4 12h3m4 0h9M4 18h11m4 0h1M15 4v4M9 10v4M17 16v4",
            },
          ],
        },
      ];
    
      const tasks = [
        { label: "Hero copy review", tone: "bg-success" },
        { label: "Pricing page QA", tone: "bg-warning" },
        { label: "Footer links audit", tone: "bg-faint" },
      ];
    </script>
    
    <Sidebar
      {sections}
      breakpoint="sm"
      class="h-[540px] rounded-xl border border-line"
      >{#snippet header()}
        <svg class="size-7 shrink-0" viewBox="0 0 1464 1430" aria-hidden="true"
          >{#each mark as shape (shape.points)}
            <polygon points={shape.points} class={shape.className} />
          {/each}</svg
        >
        <div class="grid min-w-0 leading-tight">
          <span class="font-semibold text-ink">MarkasUI</span>
          <span class="text-xs text-muted">Pro workspace</span>
        </div>
      {/snippet}
      {#snippet footer()}
        <span
          class="relative grid size-8 shrink-0 place-items-center rounded-full bg-primary-soft text-xs font-semibold text-ink"
        >
          RS
          <span
            aria-hidden="true"
            class="absolute -right-0.5 -bottom-0.5 size-2.5 rounded-full border-2 border-surface bg-success"
          ></span></span
        >
        <span class="grid min-w-0 flex-1 leading-tight"
          ><span class="truncate font-medium text-ink">Rina Saputra</span>
          <span class="truncate text-xs text-muted">rina@markasui.com</span></span
        >
        <svg
          class="size-4 shrink-0 text-faint"
          viewBox="0 0 24 24"
          fill="none"
          stroke="currentColor"
          stroke-width="1.5"
          stroke-linecap="round"
          stroke-linejoin="round"
          aria-hidden="true"><path d="m8 9 4-4 4 4m0 6-4 4-4-4" /></svg
        >
      {/snippet}
      <div class="flex min-w-0 flex-1 flex-col gap-4 p-5">
        <div class="grid gap-1">
          <p class="text-xs text-muted">Projects / Website redesign</p>
          <p class="text-lg font-semibold tracking-tight text-ink">Sprint 14</p>
        </div>
        <div class="grid grid-cols-2 gap-3">
          <div class="rounded-xl border border-line bg-surface p-3">
            <p class="text-xs text-muted">Open</p>
            <p class="mt-1 text-xl font-semibold text-ink">24</p>
          </div>
          <div class="rounded-xl border border-line bg-surface p-3">
            <p class="text-xs text-muted">Shipped</p>
            <p class="mt-1 text-xl font-semibold text-ink">18</p>
          </div>
        </div>
        <div
          class="grid content-start gap-3 rounded-xl border border-line bg-surface p-4"
        >
          <p class="text-xs font-medium text-faint">Up next</p>
          {#each tasks as task (task.label)}
            <div class="flex items-center gap-2.5">
              <span
                aria-hidden="true"
                class={`size-2 shrink-0 rounded-full ${task.tone}`}
              ></span> <span class="truncate text-sm text-ink">{task.label}</span>
            </div>
          {/each}
        </div>
      </div></Sidebar
    >
    ---
    import Sidebar from "@/components/markas/Sidebar.astro";
    
    const mark = [
      { points: "354,578 1256,138 1171,430 268,868", className: "fill-ink/15" },
      { points: "553,443 1455,3 1370,295 467,733", className: "fill-ink/55" },
      {
        points: "421,762 1325,318 1240,611 336,1050",
        className: "fill-success/35",
      },
      { points: "265,1073 1169,629 1084,922 180,1362", className: "fill-ink/25" },
      { points: "93,965 997,521 912,814 8,1253", className: "fill-ink/75" },
      {
        points: "347,1135 1251,691 1166,984 262,1424",
        className: "fill-success",
      },
    ];
    
    const sections = [
      {
        items: [
          {
            label: "Home",
            href: "/",
            icon: "M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6h-6v6H4a1 1 0 0 1-1-1z",
          },
          {
            label: "Inbox",
            href: "/inbox",
            icon: "M3 13h5l1.5 3h5l1.5-3h5M5 5h14l2 8v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-6z",
            badge: 12,
          },
        ],
      },
      {
        title: "Workspace",
        items: [
          {
            label: "Projects",
            icon: "M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",
            children: [
              {
                label: "Website redesign",
                href: "/projects/website",
                active: true,
              },
              {
                label: "Mobile app",
                href: "/projects/mobile",
              },
              {
                label: "Design system",
                href: "/projects/design-system",
              },
            ],
          },
          {
            label: "Analytics",
            href: "/analytics",
            icon: "M3 3v18h18M7 15l4-4 3 3 5-6",
          },
        ],
      },
      {
        title: "Account",
        items: [
          {
            label: "Settings",
            href: "/settings",
            icon: "M4 6h9m4 0h3M4 12h3m4 0h9M4 18h11m4 0h1M15 4v4M9 10v4M17 16v4",
          },
        ],
      },
    ];
    
    const tasks = [
      { label: "Hero copy review", tone: "bg-success" },
      { label: "Pricing page QA", tone: "bg-warning" },
      { label: "Footer links audit", tone: "bg-faint" },
    ];
    ---
    
    <Sidebar
      {sections}
      breakpoint="sm"
      class="h-[540px] rounded-xl border border-line"
      ><Fragment slot="header">
        <svg class="size-7 shrink-0" viewBox="0 0 1464 1430" aria-hidden="true"
          >{mark.map((shape) => (
            <polygon points={shape.points} class={shape.className} />
          ))}</svg
        >
        <div class="grid min-w-0 leading-tight">
          <span class="font-semibold text-ink">MarkasUI</span>
          <span class="text-xs text-muted">Pro workspace</span>
        </div>
      </Fragment>
      <Fragment slot="footer">
        <span
          class="relative grid size-8 shrink-0 place-items-center rounded-full bg-primary-soft text-xs font-semibold text-ink"
        >
          RS
          <span
            aria-hidden="true"
            class="absolute -right-0.5 -bottom-0.5 size-2.5 rounded-full border-2 border-surface bg-success"
          ></span></span
        >
        <span class="grid min-w-0 flex-1 leading-tight"
          ><span class="truncate font-medium text-ink">Rina Saputra</span>
          <span class="truncate text-xs text-muted">rina@markasui.com</span></span
        >
        <svg
          class="size-4 shrink-0 text-faint"
          viewBox="0 0 24 24"
          fill="none"
          stroke="currentColor"
          stroke-width="1.5"
          stroke-linecap="round"
          stroke-linejoin="round"
          aria-hidden="true"><path d="m8 9 4-4 4 4m0 6-4 4-4-4" /></svg
        >
      </Fragment>
      <div class="flex min-w-0 flex-1 flex-col gap-4 p-5">
        <div class="grid gap-1">
          <p class="text-xs text-muted">Projects / Website redesign</p>
          <p class="text-lg font-semibold tracking-tight text-ink">Sprint 14</p>
        </div>
        <div class="grid grid-cols-2 gap-3">
          <div class="rounded-xl border border-line bg-surface p-3">
            <p class="text-xs text-muted">Open</p>
            <p class="mt-1 text-xl font-semibold text-ink">24</p>
          </div>
          <div class="rounded-xl border border-line bg-surface p-3">
            <p class="text-xs text-muted">Shipped</p>
            <p class="mt-1 text-xl font-semibold text-ink">18</p>
          </div>
        </div>
        <div
          class="grid content-start gap-3 rounded-xl border border-line bg-surface p-4"
        >
          <p class="text-xs font-medium text-faint">Up next</p>
          {tasks.map((task) => (
            <div class="flex items-center gap-2.5">
              <span
                aria-hidden="true"
                class={`size-2 shrink-0 rounded-full ${task.tone}`}
              ></span> <span class="truncate text-sm text-ink">{task.label}</span>
            </div>
          ))}
        </div>
      </div></Sidebar
    >
    import { Component } from "@angular/core";
    import { Sidebar } from "./markas/sidebar.component";
    
    const mark = [
      { points: "354,578 1256,138 1171,430 268,868", className: "fill-ink/15" },
      { points: "553,443 1455,3 1370,295 467,733", className: "fill-ink/55" },
      {
        points: "421,762 1325,318 1240,611 336,1050",
        className: "fill-success/35",
      },
      { points: "265,1073 1169,629 1084,922 180,1362", className: "fill-ink/25" },
      { points: "93,965 997,521 912,814 8,1253", className: "fill-ink/75" },
      {
        points: "347,1135 1251,691 1166,984 262,1424",
        className: "fill-success",
      },
    ];
    
    const sections = [
      {
        items: [
          {
            label: "Home",
            href: "/",
            icon: "M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6h-6v6H4a1 1 0 0 1-1-1z",
          },
          {
            label: "Inbox",
            href: "/inbox",
            icon: "M3 13h5l1.5 3h5l1.5-3h5M5 5h14l2 8v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-6z",
            badge: 12,
          },
        ],
      },
      {
        title: "Workspace",
        items: [
          {
            label: "Projects",
            icon: "M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",
            children: [
              {
                label: "Website redesign",
                href: "/projects/website",
                active: true,
              },
              {
                label: "Mobile app",
                href: "/projects/mobile",
              },
              {
                label: "Design system",
                href: "/projects/design-system",
              },
            ],
          },
          {
            label: "Analytics",
            href: "/analytics",
            icon: "M3 3v18h18M7 15l4-4 3 3 5-6",
          },
        ],
      },
      {
        title: "Account",
        items: [
          {
            label: "Settings",
            href: "/settings",
            icon: "M4 6h9m4 0h3M4 12h3m4 0h9M4 18h11m4 0h1M15 4v4M9 10v4M17 16v4",
          },
        ],
      },
    ];
    
    const tasks = [
      { label: "Hero copy review", tone: "bg-success" },
      { label: "Pricing page QA", tone: "bg-warning" },
      { label: "Footer links audit", tone: "bg-faint" },
    ];
    
    @Component({
      selector: "markas-example",
      imports: [Sidebar],
      template: `
        <markas-sidebar
          [sections]="sections"
          breakpoint="sm"
          class="h-[540px] rounded-xl border border-line"
          ><ng-template #header>
            <svg class="size-7 shrink-0" viewBox="0 0 1464 1430" aria-hidden="true">
              @for (shape of mark; track shape.points) {
                <polygon
                  [attr.points]="shape.points"
                  [class]="shape.className"
                ></polygon>
              }
            </svg>
            <div class="grid min-w-0 leading-tight">
              <span class="font-semibold text-ink">MarkasUI</span>
              <span class="text-xs text-muted">Pro workspace</span>
            </div>
          </ng-template>
          <ng-template #footer>
            <span
              class="relative grid size-8 shrink-0 place-items-center rounded-full bg-primary-soft text-xs font-semibold text-ink"
            >
              RS
              <span
                aria-hidden="true"
                class="absolute -right-0.5 -bottom-0.5 size-2.5 rounded-full border-2 border-surface bg-success"
              ></span
            ></span>
            <span class="grid min-w-0 flex-1 leading-tight"
              ><span class="truncate font-medium text-ink">Rina Saputra</span>
              <span class="truncate text-xs text-muted"
                >rina&#64;markasui.com</span
              ></span
            >
            <svg
              class="size-4 shrink-0 text-faint"
              viewBox="0 0 24 24"
              fill="none"
              stroke="currentColor"
              stroke-width="1.5"
              stroke-linecap="round"
              stroke-linejoin="round"
              aria-hidden="true"
            >
              <path d="m8 9 4-4 4 4m0 6-4 4-4-4"></path>
            </svg>
          </ng-template>
          <div class="flex min-w-0 flex-1 flex-col gap-4 p-5">
            <div class="grid gap-1">
              <p class="text-xs text-muted">Projects / Website redesign</p>
              <p class="text-lg font-semibold tracking-tight text-ink">Sprint 14</p>
            </div>
            <div class="grid grid-cols-2 gap-3">
              <div class="rounded-xl border border-line bg-surface p-3">
                <p class="text-xs text-muted">Open</p>
                <p class="mt-1 text-xl font-semibold text-ink">24</p>
              </div>
              <div class="rounded-xl border border-line bg-surface p-3">
                <p class="text-xs text-muted">Shipped</p>
                <p class="mt-1 text-xl font-semibold text-ink">18</p>
              </div>
            </div>
            <div
              class="grid content-start gap-3 rounded-xl border border-line bg-surface p-4"
            >
              <p class="text-xs font-medium text-faint">Up next</p>
              @for (task of tasks; track task.label) {
                <div class="flex items-center gap-2.5">
                  <span
                    aria-hidden="true"
                    [class]="\`size-2 shrink-0 rounded-full \${task.tone}\`"
                  ></span>
                  <span class="truncate text-sm text-ink">{{ task.label }}</span>
                </div>
              }
            </div>
          </div></markas-sidebar
        >
      `,
    })
    export default class SidebarExample {
      protected readonly mark = mark;
      protected readonly sections = sections;
      protected readonly tasks = tasks;
    }

    Examples

    Workspace switcher

    Free plan3 of 5 projects

    Unlock every template and the Figma kit.

    Upgrade to Pro
    DA Dimas Aryadimas@markasui.com

    Monday, 9 November

    Hi, Dimas

    Today

    Review pricing PR

    Ship Combobox docs

    Fix Modal focus

    Free plan3 of 5 projects

    Unlock every template and the Figma kit.

    Upgrade to Pro
    DADimas Aryadimas@markasui.com

    Monday, 9 November

    Hi, Dimas

    Today

    Review pricing PR

    Ship Combobox docs

    Fix Modal focus

    Free plan3 of 5 projects

    Unlock every template and the Figma kit.

    Upgrade to Pro
    DA Dimas Aryadimas@markasui.com

    Monday, 9 November

    Hi, Dimas

    Today

    Review pricing PR

    Ship Combobox docs

    Fix Modal focus

    Free plan 3 of 5 projects

    Unlock every template and the Figma kit.

    Upgrade to Pro
    DA Dimas Arya dimas@markasui.com

    Monday, 9 November

    Hi, Dimas

    Today

    Review pricing PR

    Ship Combobox docs

    Fix Modal focus

    Free plan3 of 5 projects

    Unlock every template and the Figma kit.

    Upgrade to Pro
    DADimas Aryadimas@markasui.com

    Monday, 9 November

    Hi, Dimas

    Today

    Review pricing PR

    Ship Combobox docs

    Fix Modal focus

    Rail and panel

    Search and groups

    MarkasUI
    Projects
    Website relaunch
    Design system
    Reports
    Weekly summary
    Actions
    Create project
    Invite teammate
    PK Putri KiranaAdmin
    Projects
    Website relaunch
    Design system
    Reports
    Weekly summary
    Actions
    Create project
    Invite teammate
    ⌘ K

    Jump to anything

    Search projects, reports, and actions without leaving the keyboard.

    MarkasUI
    Projects
    Website relaunch
    Design system
    Reports
    Weekly summary
    Actions
    Create project
    Invite teammate
    PKPutri KiranaAdmin
    Projects
    Website relaunch
    Design system
    Reports
    Weekly summary
    Actions
    Create project
    Invite teammate
    ⌘K

    Jump to anything

    Search projects, reports, and actions without leaving the keyboard.

    MarkasUI
    Projects
    Website relaunch
    Design system
    Reports
    Weekly summary
    Actions
    Create project
    Invite teammate
    PK Putri KiranaAdmin
    Projects
    Website relaunch
    Design system
    Reports
    Weekly summary
    Actions
    Create project
    Invite teammate
    ⌘ K

    Jump to anything

    Search projects, reports, and actions without leaving the keyboard.

    MarkasUI
    Projects
    Website relaunch
    Design system
    Reports
    Weekly summary
    Actions
    Create project
    Invite teammate
    PK Putri Kirana Admin
    Projects
    Website relaunch
    Design system
    Reports
    Weekly summary
    Actions
    Create project
    Invite teammate
    ⌘ K

    Jump to anything

    Search projects, reports, and actions without leaving the keyboard.

    MarkasUI
    Projects
    Website relaunch
    Design system
    Reports
    Weekly summary
    Actions
    Create project
    Invite teammate
    PKPutri KiranaAdmin
    Projects
    Website relaunch
    Design system
    Reports
    Weekly summary
    Actions
    Create project
    Invite teammate
    ⌘K

    Jump to anything

    Search projects, reports, and actions without leaving the keyboard.

    Dark accent

    MarkasUIProduction
    BH Bayu HartonoOwner

    Overview

    markasui.com

    Recent deployments

    main8f3c2a1 2m ago
    docs/tabs41be9d0 1h ago
    fix/modalc07a3e5 3h ago
    MarkasUIProduction
    BHBayu HartonoOwner

    Overview

    markasui.com

    Recent deployments

    main8f3c2a12m ago
    docs/tabs41be9d01h ago
    fix/modalc07a3e53h ago
    MarkasUI Production
    BH Bayu HartonoOwner

    Overview

    markasui.com

    Recent deployments

    main8f3c2a12m ago
    docs/tabs41be9d01h ago
    fix/modalc07a3e53h ago
    MarkasUI Production
    BH Bayu Hartono Owner

    Overview

    markasui.com

    Recent deployments

    main 8f3c2a1 2m ago
    docs/tabs 41be9d0 1h ago
    fix/modal c07a3e5 3h ago
    MarkasUIProduction
    BHBayu HartonoOwner

    Overview

    markasui.com

    Recent deployments

    main8f3c2a1 2m ago
    docs/tabs41be9d0 1h ago
    fix/modalc07a3e5 3h ago

    Documentation

    MarkasUI v1.4

    Components / Forms

    Select

    A native select with a custom chevron, three sizes, and an error state.

    Bandung

    On this page

    Usage

    Sizes

    Error state

    MarkasUIv1.4

    Components / Forms

    Select

    A native select with a custom chevron, three sizes, and an error state.

    Bandung

    On this page

    Usage

    Sizes

    Error state

    MarkasUI v1.4

    Components / Forms

    Select

    A native select with a custom chevron, three sizes, and an error state.

    Bandung

    On this page

    Usage

    Sizes

    Error state

    MarkasUI v1.4

    Components / Forms

    Select

    A native select with a custom chevron, three sizes, and an error state.

    Bandung

    On this page

    Usage

    Sizes

    Error state

    MarkasUIv1.4

    Components / Forms

    Select

    A native select with a custom chevron, three sizes, and an error state.

    Bandung

    On this page

    Usage

    Sizes

    Error state

    Floating

    MarkasUITeam plan
    RS Rina Saputrarina@markasui.com

    Weekly visitors

    12,480

    +18%
    MarkasUITeam plan
    RSRina Saputrarina@markasui.com

    Weekly visitors

    12,480

    +18%
    MarkasUITeam plan
    RS Rina Saputrarina@markasui.com

    Weekly visitors

    12,480

    +18%
    MarkasUI Team plan
    RS Rina Saputra rina@markasui.com

    Weekly visitors

    12,480

    +18%
    MarkasUITeam plan
    RSRina Saputrarina@markasui.com

    Weekly visitors

    12,480

    +18%

    Installation

    npx markasui@latest add sidebar

    Usage

    <x-markas.sidebar :sections="[
        ['items' => [
            ['label' => 'Home', 'href' => '/', 'icon' => 'M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6h-6v6H4a1 1 0 0 1-1-1z'],
            ['label' => 'Inbox', 'href' => '/inbox', 'icon' => 'M3 13h5l1.5 3h5l1.5-3h5M5 5h14l2 8v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-6z', 'badge' => 12],
        ]],
        ['title' => 'Workspace', 'items' => [
            ['label' => 'Projects', 'icon' => 'M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z', 'children' => [
                ['label' => 'Website redesign', 'href' => '/projects/website', 'active' => true],
                ['label' => 'Mobile app', 'href' => '/projects/mobile'],
            ]],
        ]],
    ]" class="h-dvh">
        <x-slot:header>MarkasUI</x-slot:header>
        <x-slot:footer>Rina Saputra</x-slot:footer>
    
        <main class="flex-1 p-6">...</main>
    </x-markas.sidebar>

    Needs Alpine.js. Listen for rail changes with x-on:markas-collapsed-change="saved = $event.detail".

    import { Sidebar } from "@/components/markas/Sidebar";
    
    const sections = [
      {
        items: [
          {
            label: "Home",
            href: "/",
            icon: "M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6h-6v6H4a1 1 0 0 1-1-1z",
          },
          {
            label: "Inbox",
            href: "/inbox",
            icon: "M3 13h5l1.5 3h5l1.5-3h5M5 5h14l2 8v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-6z",
            badge: 12,
          },
        ],
      },
      {
        title: "Workspace",
        items: [
          {
            label: "Projects",
            icon: "M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",
            children: [
              {
                label: "Website redesign",
                href: "/projects/website",
                active: true,
              },
              { label: "Mobile app", href: "/projects/mobile" },
            ],
          },
        ],
      },
    ];
    
    const [collapsed, setCollapsed] = useState(false);
    
    <Sidebar
      sections={sections}
      header="MarkasUI"
      footer="Rina Saputra"
      collapsed={collapsed}
      onCollapsedChange={setCollapsed}
      className="h-dvh"
    >
      <main className="flex-1 p-6">...</main>
    </Sidebar>;
    <script setup lang="ts">
    import { ref } from "vue";
    import Sidebar from "@/components/markas/Sidebar.vue";
    
    const collapsed = ref(false);
    // sections: same shape as the React example
    </script>
    
    <template>
      <Sidebar v-model:collapsed="collapsed" :sections="sections" class="h-dvh">
        <template #header>MarkasUI</template>
        <template #footer>Rina Saputra</template>
        <main class="flex-1 p-6">...</main>
      </Sidebar>
    </template>
    <script lang="ts">
      import Sidebar from "$lib/components/markas/Sidebar.svelte";
    
      let collapsed = $state(false);
      // sections: same shape as the React example
    </script>
    
    <Sidebar bind:collapsed {sections} class="h-dvh">
      {#snippet header()}MarkasUI{/snippet}
      {#snippet footer()}Rina Saputra{/snippet}
      <main class="flex-1 p-6">...</main>
    </Sidebar>
    ---
    import Sidebar from "@/components/markas/Sidebar.astro";
    // sections: same shape as the React example
    ---
    
    <Sidebar sections={sections} class="h-dvh">
      <Fragment slot="header">MarkasUI</Fragment>
      <Fragment slot="footer">Rina Saputra</Fragment>
      <main class="flex-1 p-6">...</main>
    </Sidebar>

    A small bundled script handles the rail toggle, sub-item groups, and the mobile dialog for every sidebar on the page. Listen for rail changes with addEventListener("markas-collapsed-change", (e) => e.detail).

    import { Component, signal } from "@angular/core";
    import { Sidebar } from "./markas/sidebar.component";
    
    @Component({
      selector: "app-shell",
      imports: [Sidebar],
      template: `
        <markas-sidebar
          [(collapsed)]="collapsed"
          [sections]="sections"
          class="h-dvh"
        >
          <ng-template #header>MarkasUI</ng-template>
          <ng-template #footer>Rina Saputra</ng-template>
          <main class="flex-1 p-6">...</main>
        </markas-sidebar>
      `,
    })
    export class AppShell {
      readonly collapsed = signal(false);
      // sections: same shape as the React example
    }

    header and footer are ng-templates because they render twice: in the sidebar and in the mobile dialog.

    • The component is the whole app shell: put the page content inside it. Its width decides the layout through a container query. From breakpoint (default md, 42rem) the sidebar sits next to the content; below it a menu button opens the same links in a native <dialog> that slides in from the left.
    • The round button on the sidebar edge switches to a 64px icon rail. Labels then show as tooltips and badges as a dot. The state is uncontrolled by default. Start in rail mode with defaultCollapsed in React, :collapsed="true" without v-model in Vue and Blade, or a plain collapsed value in Svelte, Astro, and Angular.
    • In rail mode a parent item expands the sidebar and opens its sub-items.
    • The highlight slides to the hovered or focused item and back to the active one. It uses CSS anchor positioning, so it needs no JavaScript; browsers without it still mark the active item with bold text. Sub-item groups that hold the active page start open; set open to override.
    • header and footer render twice: once in the sidebar and once in the mobile dialog. A workspace switcher (DropdownMenu) or a search trigger (Command) works in both copies; in Blade, ids inside the dialog copy get a -m suffix so they stay unique (Astro: an m- prefix).
    • Hide parts of the header or footer in rail mode with in-data-[state=collapsed]:hidden, for example an upgrade card.
    • Labels default to English: “Sidebar”, “Collapse sidebar”, “Expand sidebar”, “Open sidebar”, and “Close sidebar”. Translate them with navLabel, collapseLabel, expandLabel, openLabel, and closeLabel (Blade: nav-label, collapse-label, and so on).

    Props

    NameTypeDefaultDescription
    sections{ title?, items: { label, href?, icon?, badge?, active?, disabled?, open?, children? }[] }[][]Link groups. icon is an SVG path (d) for a 24px stroke icon. Items with children become toggle buttons.
    headerslot / ReactNode / snippet-Brand or workspace at the top. In rail mode only the first 32px stay visible. Angular: <ng-template #header>, since it renders in the sidebar and the mobile dialog.
    footerslot / ReactNode / snippet-User profile at the bottom. Angular: <ng-template #footer>.
    childrenslot / ReactNode / snippet-Page content shown next to the sidebar.
    variant"default" | "floating"defaultdefault sits flush with a right border, floating is an inset rounded panel.
    breakpoint"sm" | "md" | "lg"mdContainer width from which the sidebar shows next to the content: 24rem, 42rem, or 56rem. Below it a button opens it as a dialog.
    collapsedboolean-Icon rail mode. React: controlled with onCollapsedChange. Vue: v-model:collapsed, or a plain value for the uncontrolled initial state. Svelte: bind:collapsed or a plain initial value. Angular: [(collapsed)] or a plain initial value. Blade and Astro: initial state, changes dispatch markas-collapsed-change.
    defaultCollapsedbooleanfalseInitial rail mode when uncontrolled (React only).
    collapsedChangeoutput<boolean>-Angular only. Emits the new rail state when it changes.
    navLabelstringSidebarAccessible label of the nav and the mobile dialog.
    collapseLabelstringCollapse sidebarAccessible label of the rail toggle while expanded.
    expandLabelstringExpand sidebarAccessible label of the rail toggle while collapsed.
    openLabelstringOpen sidebarAccessible label of the button that opens the mobile dialog.
    closeLabelstringClose sidebarAccessible label of the close button in the mobile dialog.

    Accessibility

    • Links sit in a nav labelled by navLabel, the current page gets aria-current=page, and each titled group is a list labelled by its title.
    • Items with sub-items are disclosure buttons with aria-expanded and aria-controls, closed sub-items are hidden from focus.
    • The rail toggle uses aria-expanded and aria-controls pointing to the sidebar. In rail mode labels stay readable by screen readers and show as tooltips on hover and focus.
    • On narrow layouts the sidebar opens in a native modal dialog: Escape or the backdrop closes it and focus returns to the open button.
    • Disabled items are links without href and with aria-disabled=true.

    Related components

    More navigation components with the same classes in every framework.