Shopify Polaris
JS behaviour
Page Header
An oversized title with a green primary action, secondary actions and breadcrumbs up top — the standard opening frame of every Shopify admin page.
Real scenarios
The component as it is used in a product — not a specimen grid.
The door of every admin page
Breadcrumbs, an oversized title with a live count, the green primary action and secondary actions in one row. The primary action really answers, and the kebab menu opens for real.
Orders 32
Back, avatar and in-header pagination
Deep pages swap the trail for a back button; resource headers carry the shop avatar; record headers step through «32 of 128» — and here the arrows really step.
Order #1001
Nabu Home & Living
myshop.nabu.example
Customers
32 of 128Important props
| Prop | Type | Default | What it does |
|---|---|---|---|
| breadcrumbs | trail | '[]' | The trail above the title; a back-arrow variant replaces it on deep pages. |
| primary-action | button | 'green' | The primary action in brand green #008060 at the title row's end. |
| pagination | inline | null | In-header pagination: «32 of 128» with two arrow buttons for stepping records. |
Snippet
<header class="plph">
<nav class="plph-crumbs"><a>Home</a><a>Shop</a><span>Orders</span></nav>
<div class="plph-row">
<h1>Orders</h1>
<div class="plph-actions">
<button data-secondary>Export</button>
<button data-primary>Create order</button>
</div>
</div>
</header>
<style>
.plph { display: grid; gap: 8px; padding: 16px; }
.plph h1 { margin: 0; font: 600 24px/1.2 Inter, system-ui; color: #303030; }
.plph-actions { display: flex; gap: 8px; margin-inline-start: auto; }
.plph [data-primary] { block-size: 36px; padding-inline: 16px; border: none;
border-radius: 8px; background: #008060; color: #FFF; }
.plph [data-secondary] { background: #FFF; border: 1px solid #8A8A8A; border-radius: 8px; }
</style>
// resources/js/Pages/Orders/Index.tsx — on a real page the crumbs
// become Inertia Links; the header itself is the React snippet.
import { Head, Link } from '@inertiajs/react';
import PageHeader from '@/components/polaris/PageHeader';
export default function OrdersIndex() {
return (
<>
<Head title="Orders" />
{/* Swap the snippet's crumb <a>s for <Link href="/shop">Shop</Link> */}
<PageHeader />
</>
);
}
import { useState } from 'react';
import '@nabuxai/ui-core/css';
export default function PageHeader() {
const [count, setCount] = useState(32);
const [menu, setMenu] = useState(false);
return (
<header className="plph">
<nav className="plph-crumbs" aria-label="Breadcrumbs">
<a href="#">Home</a><a href="#">Shop</a><span aria-current="page">Orders</span>
</nav>
<div className="plph-row">
<h1>Orders <span className="plph-count">{count}</span></h1>
<div className="plph-actions">
<button data-secondary>Export</button>
<button data-primary onClick={() => setCount(count + 1)}>Create order</button>
<button className="plph-kebab" aria-expanded={menu} aria-label="More actions" onClick={() => setMenu(!menu)}>⋯</button>
</div>
</div>
{menu && (
<div className="plph-menu" role="menu">
<button onClick={() => setMenu(false)}>View all orders</button>
<button onClick={() => setMenu(false)}>Draft orders</button>
</div>
)}
<style>{`
.plph { display: grid; gap: 8px; padding: 16px; }
.plph h1 { margin: 0; font: 600 24px/1.2 Inter, system-ui; color: #303030; }
.plph-actions { display: flex; gap: 8px; margin-inline-start: auto; }
.plph [data-primary] { block-size: 36px; padding-inline: 16px; border: none;
border-radius: 8px; background: #008060; color: #FFF; }
.plph [data-secondary] { background: #FFF; border: 1px solid #8A8A8A; border-radius: 8px; }
`}</style>
</header>
);
}
<!-- PageHeader.vue -->
<script setup lang="ts">
import { ref } from 'vue';
import '@nabuxai/ui-core/css';
const count = ref(32);
const menu = ref(false);
</script>
<template>
<header class="plph">
<nav class="plph-crumbs" aria-label="Breadcrumbs">
<a href="#">Home</a><a href="#">Shop</a><span aria-current="page">Orders</span>
</nav>
<div class="plph-row">
<h1>Orders <span class="plph-count">{{ count }}</span></h1>
<div class="plph-actions">
<button data-secondary>Export</button>
<button data-primary @click="count++">Create order</button>
<button class="plph-kebab" :aria-expanded="menu" aria-label="More actions" @click="menu = !menu">⋯</button>
</div>
</div>
<div v-if="menu" class="plph-menu" role="menu">
<button @click="menu = false">View all orders</button>
<button @click="menu = false">Draft orders</button>
</div>
</header>
</template>
<style scoped>
.plph { display: grid; gap: 8px; padding: 16px; }
.plph h1 { margin: 0; font: 600 24px/1.2 Inter, system-ui; color: #303030; }
.plph-actions { display: flex; gap: 8px; margin-inline-start: auto; }
.plph [data-primary] { block-size: 36px; padding-inline: 16px; border: none;
border-radius: 8px; background: #008060; color: #fff; }
.plph [data-secondary] { background: #fff; border: 1px solid #8a8a8a; border-radius: 8px; }
</style>
<!-- PageHeader.svelte -->
<script lang="ts">
import '@nabuxai/ui-core/css';
let count = $state(32);
let menu = $state(false);
</script>
<header class="plph">
<nav class="plph-crumbs" aria-label="Breadcrumbs">
<a href="#/">Home</a><a href="#/shop">Shop</a><span aria-current="page">Orders</span>
</nav>
<div class="plph-row">
<h1>Orders <span class="plph-count">{count}</span></h1>
<div class="plph-actions">
<button data-secondary>Export</button>
<button data-primary onclick={() => count++}>Create order</button>
<button class="plph-kebab" aria-expanded={menu} aria-label="More actions" onclick={() => (menu = !menu)}>⋯</button>
</div>
</div>
{#if menu}
<div class="plph-menu" role="menu">
<button onclick={() => (menu = false)}>View all orders</button>
<button onclick={() => (menu = false)}>Draft orders</button>
</div>
{/if}
</header>
<style>
.plph { display: grid; gap: 8px; padding: 16px; }
.plph h1 { margin: 0; font: 600 24px/1.2 Inter, system-ui; color: #303030; }
.plph-actions { display: flex; gap: 8px; margin-inline-start: auto; }
.plph [data-primary] { block-size: 36px; padding-inline: 16px; border: none;
border-radius: 8px; background: #008060; color: #fff; }
.plph [data-secondary] { background: #fff; border: 1px solid #8a8a8a; border-radius: 8px; }
</style>