List where any row can be pinned. Pinned rows glide into a Pinned group at the top with a FLIP animation and glide back when unpinned.
Pinned1
- Onboarding checklistPeople, 23 itemsMon
All4
- Q4 roadmapProduct, 14 pages2h
- Client invoicesFinance, 8 filesYesterday
- Brand guidelinesDesign, 31 pagesOct 28
- Standup notesEngineering, dailyOct 27
Pinned1
- Onboarding checklistPeople, 23 itemsMon
All4
- Q4 roadmapProduct, 14 pages2h
- Client invoicesFinance, 8 filesYesterday
- Brand guidelinesDesign, 31 pagesOct 28
- Standup notesEngineering, dailyOct 27
Pinned1
- Onboarding checklist People, 23 items Mon
All4
- Q4 roadmap Product, 14 pages 2h
- Client invoices Finance, 8 files Yesterday
- Brand guidelines Design, 31 pages Oct 28
- Standup notes Engineering, daily Oct 27
Pinned1
- Onboarding checklistPeople, 23 itemsMon
All4
- Q4 roadmapProduct, 14 pages2h
- Client invoicesFinance, 8 filesYesterday
- Brand guidelinesDesign, 31 pagesOct 28
- Standup notesEngineering, dailyOct 27
@php
$items = [
['value' => 'roadmap', 'label' => 'Q4 roadmap', 'description' => 'Product, 14 pages', 'meta' => '2h', 'icon' => 'M9 4 3 6v14l6-2 6 2 6-2V4l-6 2zM9 4v14M15 6v14'],
['value' => 'invoices', 'label' => 'Client invoices', 'description' => 'Finance, 8 files', 'meta' => 'Yesterday', 'icon' => 'M5 3h14v18l-3-2-2 2-2-2-2 2-2-2-3 2zM9 8h6M9 12h6'],
['value' => 'onboarding', 'label' => 'Onboarding checklist', 'description' => 'People, 23 items', 'meta' => 'Mon', 'icon' => 'M9 6h11M9 12h11M9 18h11M4 6l1 1 2-2M4 12l1 1 2-2M4 18l1 1 2-2'],
['value' => 'brand', 'label' => 'Brand guidelines', 'description' => 'Design, 31 pages', 'meta' => 'Oct 28', 'icon' => 'M12 20h9M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z'],
['value' => 'standup', 'label' => 'Standup notes', 'description' => 'Engineering, daily', 'meta' => 'Oct 27', 'icon' => 'M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'],
];
@endphp
<x-markas.pinned-list :items="$items" :default-pinned="['onboarding']" />Examples
Chat channels
Pinned2
- design-critWeekly critiques, Thursdays14
- launch-q4Release checklist and status36
All2
- generalCompany-wide announcements128
- randomCats, lunch, and memes9
Pinned2
- design-critWeekly critiques, Thursdays14
- launch-q4Release checklist and status36
All2
- generalCompany-wide announcements128
- randomCats, lunch, and memes9
Pinned2
- design-crit Weekly critiques, Thursdays 14
- launch-q4 Release checklist and status 36
All2
- general Company-wide announcements 128
- random Cats, lunch, and memes 9
Pinned2
- design-critWeekly critiques, Thursdays14
- launch-q4Release checklist and status36
All2
- generalCompany-wide announcements128
- randomCats, lunch, and memes9
@php
$items = [
['value' => 'general', 'label' => 'general', 'description' => 'Company-wide announcements', 'meta' => '128', 'icon' => 'M4 9h16M4 15h16M10 3 8 21M16 3l-2 18'],
['value' => 'design', 'label' => 'design-crit', 'description' => 'Weekly critiques, Thursdays', 'meta' => '14', 'icon' => 'M4 9h16M4 15h16M10 3 8 21M16 3l-2 18'],
['value' => 'launch', 'label' => 'launch-q4', 'description' => 'Release checklist and status', 'meta' => '36', 'icon' => 'M4 9h16M4 15h16M10 3 8 21M16 3l-2 18'],
['value' => 'random', 'label' => 'random', 'description' => 'Cats, lunch, and memes', 'meta' => '9', 'icon' => 'M4 9h16M4 15h16M10 3 8 21M16 3l-2 18'],
];
@endphp
<x-markas.pinned-list :items="$items" :default-pinned="['design', 'launch']" />Simple rows
Pinned0
All4
- Jakarta31°C
- Bandung24°C
- Surabaya33°C
- Denpasar29°C
Pinned0
All4
- Jakarta31°C
- Bandung24°C
- Surabaya33°C
- Denpasar29°C
Pinned0
All4
- Jakarta 31°C
- Bandung 24°C
- Surabaya 33°C
- Denpasar 29°C
Pinned0
All4
- Jakarta31°C
- Bandung24°C
- Surabaya33°C
- Denpasar29°C
@php
$items = [
['value' => 'jakarta', 'label' => 'Jakarta', 'meta' => '31°C'],
['value' => 'bandung', 'label' => 'Bandung', 'meta' => '24°C'],
['value' => 'surabaya', 'label' => 'Surabaya', 'meta' => '33°C'],
['value' => 'denpasar', 'label' => 'Denpasar', 'meta' => '29°C'],
];
@endphp
<x-markas.pinned-list :items="$items" />import { PinnedList } from "@/components/markas/PinnedList";
const items = [
{ value: "jakarta", label: "Jakarta", meta: "31°C" },
{ value: "bandung", label: "Bandung", meta: "24°C" },
{ value: "surabaya", label: "Surabaya", meta: "33°C" },
{ value: "denpasar", label: "Denpasar", meta: "29°C" },
];
export default function Example() {
return <PinnedList items={items} />;
}<script lang="ts">
import PinnedList from "$lib/components/markas/PinnedList.svelte";
const items = [
{ value: "jakarta", label: "Jakarta", meta: "31°C" },
{ value: "bandung", label: "Bandung", meta: "24°C" },
{ value: "surabaya", label: "Surabaya", meta: "33°C" },
{ value: "denpasar", label: "Denpasar", meta: "29°C" },
];
</script>
<PinnedList {items} />---
import PinnedList from "@/components/markas/PinnedList.astro";
const items = [
{ value: "jakarta", label: "Jakarta", meta: "31°C" },
{ value: "bandung", label: "Bandung", meta: "24°C" },
{ value: "surabaya", label: "Surabaya", meta: "33°C" },
{ value: "denpasar", label: "Denpasar", meta: "29°C" },
];
---
<PinnedList items={items} />Saved searches in a card
Quick filters
Quick filters
Favorites1
- Trials ending this weekCustomers, 42 results
Saved searches2
- Unpaid over Rp 5.000.000Invoices, 6 results
- Churned this monthCustomers, 18 results
Quick filters
Favorites1
- Trials ending this weekCustomers, 42 results
Saved searches2
- Unpaid over Rp 5.000.000Invoices, 6 results
- Churned this monthCustomers, 18 results
Quick filters
Favorites1
- Trials ending this week Customers, 42 results
Saved searches2
- Unpaid over Rp 5.000.000 Invoices, 6 results
- Churned this month Customers, 18 results
Quick filters
Favorites1
- Trials ending this weekCustomers, 42 results
Saved searches2
- Unpaid over Rp 5.000.000Invoices, 6 results
- Churned this monthCustomers, 18 results
@php
$items = [
['value' => 'unpaid', 'label' => 'Unpaid over Rp 5.000.000', 'description' => 'Invoices, 6 results'],
['value' => 'churn', 'label' => 'Churned this month', 'description' => 'Customers, 18 results'],
['value' => 'trial', 'label' => 'Trials ending this week', 'description' => 'Customers, 42 results'],
];
@endphp
<div class="grid gap-4 rounded-xl border border-line bg-surface p-4">
<p class="px-1 text-base font-semibold text-ink">Quick filters</p>
<x-markas.pinned-list :items="$items" :default-pinned="['trial']" pinned-label="Favorites" all-label="Saved searches" />
</div>Installation
npx markasui@latest add pinned-listpnpm dlx markasui@latest add pinned-listyarn dlx markasui@latest add pinned-listbunx --bun markasui@latest add pinned-list- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Install the dependency:
npm install alpinejs - Copy the component source below to
resources/views/components/markas/pinned-list.blade.php.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/PinnedList.tsx.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/PinnedList.vue.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/lib/components/markas/PinnedList.svelte.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/PinnedList.astro.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/app/markas/pinned-list.component.ts.
Usage
<x-markas.pinned-list
:default-pinned="$user->pinned_channels"
x-on:change="fetch('/pins', { method: 'PUT', body: JSON.stringify($event.detail) })"
:items="[
['value' => 'general', 'label' => 'general', 'description' => 'Company-wide announcements', 'meta' => '128'],
['value' => 'design', 'label' => 'design-crit', 'description' => 'Weekly critiques', 'meta' => '14'],
['value' => 'random', 'label' => 'random', 'meta' => '9'],
]"
/>import { PinnedList } from "@/components/markas/PinnedList";
const [pinned, setPinned] = useState<string[]>(["design"]);
<PinnedList items={channels} pinned={pinned} onPinnedChange={setPinned} />;<script setup lang="ts">
import { ref } from "vue";
import PinnedList from "@/components/markas/PinnedList.vue";
const pinned = ref(["design"]);
</script>
<template>
<PinnedList v-model:pinned="pinned" :items="channels" />
</template><script lang="ts">
import PinnedList from "$lib/components/markas/PinnedList.svelte";
const items = [
{ value: "roadmap", label: "Q4 roadmap", description: "Product, 14 pages" },
{ value: "standup", label: "Standup notes", description: "Team, daily" },
];
let pinned = $state(["roadmap"]);
</script>
<PinnedList {items} bind:pinned />---
import PinnedList from "@/components/markas/PinnedList.astro";
const items = [
{ value: "roadmap", label: "Q4 roadmap", description: "Product, 14 pages" },
{ value: "standup", label: "Standup notes", description: "Team, daily" },
];
---
<PinnedList items={items} defaultPinned={["roadmap"]} />A small bundled script moves the rows and dispatches change with the pinned values.
import { Component, signal } from "@angular/core";
import { PinnedList } from "./markas/pinned-list.component";
@Component({
selector: "app-docs",
imports: [PinnedList],
template: `<markas-pinned-list [items]="items" [(pinned)]="pinned" />`,
})
export class Docs {
readonly items = [
{ value: "roadmap", label: "Q4 roadmap", description: "Product, 14 pages" },
{ value: "standup", label: "Standup notes", description: "Team, daily" },
];
readonly pinned = signal(["roadmap"]);
}- Pinned rows keep the order of items, so unpinning returns a row to its original place.
- The move uses FLIP: every row is measured before and after the change and animated from the old spot with the Web Animations API. No layout library is needed.
- {label} in pinLabel, unpinLabel, pinnedMessage, and unpinnedMessage is replaced by the row label.
- Blade renders the rows with Alpine x-for and needs Alpine.js.
Props
| Name | Type | Default | Description |
|---|---|---|---|
items | { value: string; label: string; description?: string; meta?: string; icon?: string }[] | [] | Rows in their natural order. icon is the d attribute of a 24x24 stroked SVG path, meta is short text on the right. |
pinned / v-model:pinned | string[] | - | Controlled pinned values in React (with onPinnedChange) and Vue (v-model:pinned). |
defaultPinned | string[] | [] | Values pinned on first render. |
onPinnedChange / x-on:change | (pinned: string[]) => void | - | Fires after a pin or unpin with the new list. Blade dispatches a change DOM event with the list as detail. |
pinLabel | string | Pin {label} | Accessible name of each pin button. It stays the same while pinned, aria-pressed carries the state. |
unpinLabel | string | Unpin {label} | Hover hint (title) of the pin button while the row is pinned. |
pinnedLabel | string | Pinned | Heading and list name of the pinned group. |
allLabel | string | All | Heading and list name of the other rows. |
pinnedMessage | string | {label} pinned | Announced in the live region after pinning. |
unpinnedMessage | string | {label} unpinned | Announced in the live region after unpinning. |
pinnedChange | output<string[]> | - | Angular only. Emits the pinned values after every change; supports [(pinned)]. Svelte uses bind:pinned or onPinnedChange, Astro dispatches change. |
Accessibility
- Each pin button is a toggle button with aria-pressed and a fixed name from pinLabel.
- Both groups are lists named by pinnedLabel and allLabel. An empty group is hidden.
- Focus follows the moved row to its pin button, and a status live region announces pinnedMessage or unpinnedMessage.
- With reduced motion rows jump to their new place without the FLIP glide.
Related components
More markasui components with the same classes in every framework.
- Bottom NavigationMobile 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.
- Card StackLayered stack of cards. Swipe, arrow keys, or buttons throw the top card away and the next one rises. Loops, with a position indicator.
- Chat MessageMessage in an AI conversation. User bubbles on the right, assistant replies with an avatar, hover actions, a typing indicator, and optional token streaming.
- Currency InputMoney field that formats as you type (Rp 12.500.000), keeps the caret in place, and posts the plain number. Optional quick amount chips.
- DockmacOS style dock. Icons grow smoothly toward the pointer or focus, show a label above, mark open items with a dot, and bounce on launch.
- Drag ElementsArea of cards or stickers you can drag around with light momentum, kept inside its bounds. Arrow keys move a focused item, Escape puts it back.