Salesforce Lightning
JS behaviour
App Launcher
The famous waffle button opening a tile grid of all apps — the switcher every Salesforce screen starts with.
Real scenarios
The component as it is used in a product — not a specimen grid.
Nine dots, every app
The waffle opens the panel over the header; the search filters the tiles as you type and the counts stay honest. Escape or a click outside closes it.
Search…
All items ·
No app matches — try “Sales” or “Service”.
Tile sizes and states
Large for the launcher grid, small for dense rails; the hover state lifts the tile onto the soft brand wash.
large
standard
small
hover
Important props
| Prop | Type | Default | What it does |
|---|---|---|---|
| waffle | button | '3×3' | The header’s 3×3 dot button; it springs the app panel open and Escape closes it. |
| search | input | 'live' | The search on top of the panel live-filters the tiles as you type. |
| tile | grid | '3-col' | Colour tiles with the app’s initial; sections group their own apps. |
| all-apps | link | 'footer' | The footer’s «All Apps» link opens the full-page view. |
Snippet
<div class="sflx-launcher">
<button class="sflx-waffle" aria-expanded="false" aria-label="All apps">
<i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i>
</button>
<div class="sflx-apps" role="dialog" aria-label="Apps">
<input type="search" placeholder="Search apps…">
<section>
<h3>Sales</h3>
<a class="sflx-tile" style="--tile: #0B5CAB" href="#"><b>S</b>Sales</a>
</section>
</div>
</div>
<style>
.sflx-launcher { position: relative; }
.sflx-waffle { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: .4rem; }
.sflx-waffle i { inline-size: 3px; aspect-ratio: 1; border-radius: 50%; background: currentColor; }
.sflx-apps { position: absolute; inset-block-start: 100%; inline-size: 20rem;
background: #fff; border: 1px solid #DDDBDA; border-radius: .25rem; }
.sflx-tile b { display: grid; place-items: center; inline-size: 2rem; aspect-ratio: 1;
border-radius: .25rem; background: var(--tile); color: #fff; }
</style>
// resources/js/pages/Dashboard.tsx — an Inertia page (React flavor). The
// launcher lives in the app header; the waffle panel itself is the
// AppLauncher component from the React snippet.
import AppLauncher from '@/components/AppLauncher';
export default function Dashboard() {
return <AppLauncher />;
}
// AppLauncher.tsx — the famous 3×3 waffle in a Lightning header opening the
// app panel: live search, colour tiles with initials, honest counts, Escape
// to close. The markup mirrors the playground partial (sla-* classes).
import { type CSSProperties, useState } from 'react';
import '@nabuxai/ui-react/css';
const APPS = [
{ label: 'Sales', initial: 'S', tint: '#0B5CAB' },
{ label: 'Service', initial: 'S', tint: '#0176D3' },
{ label: 'Marketing', initial: 'M', tint: '#B32D69' },
{ label: 'Chatter', initial: 'C', tint: '#04844B' },
{ label: 'Reports', initial: 'R', tint: '#FE9339' },
{ label: 'Dashboards', initial: 'D', tint: '#6739B7' },
{ label: 'Tasks', initial: 'T', tint: '#0B827C' },
{ label: 'Notes', initial: 'N', tint: '#BA0517' },
];
export default function AppLauncher() {
const [open, setOpen] = useState(true);
const [q, setQ] = useState('');
const matches = APPS.filter((a) => a.label.toLowerCase().includes(q.trim().toLowerCase()));
return (
<div className="sla-root" onKeyDown={(e) => e.key === 'Escape' && setOpen(false)}>
<div>
<div className="sla-header">
<button type="button" className="sla-waffle" aria-expanded={open}
aria-label="Open the app launcher" onClick={() => setOpen(!open)}>
{Array.from({ length: 9 }, (_, i) => <i key={i} />)}
</button>
<span className="sla-breadcrumb">Sales / Opportunity: Nabu annual license</span>
<span className="sla-search-head">Search…</span>
</div>
{open && (
<div className="sla-panel" role="dialog" aria-label="App launcher">
<div className="sla-search">
<svg className="nx-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor"
strokeLinecap="round" aria-hidden="true"><path d="M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14zM20 20l-4-4" /></svg>
<input type="search" value={q} onChange={(e) => setQ(e.target.value)}
placeholder="Find an app…" aria-label="Search apps" />
</div>
<div className="sla-body">
<section className="sla-section">
<h3>All items · {matches.length}</h3>
<div className="sla-grid">
{matches.map((a) => (
<button key={a.label} type="button" className="sla-app"
style={{ '--sla-tint': a.tint } as CSSProperties}>
<span className="sla-tile" aria-hidden="true">{a.initial}</span>
<span>{a.label}</span>
</button>
))}
</div>
{matches.length === 0 && <p className="sla-empty">No app matches — try "Sales".</p>}
</section>
</div>
<div className="sla-foot"><button type="button">All apps →</button></div>
</div>
)}
</div>
<style>{css}</style>
</div>
);
}
const css = `
.sla-root { font-family: 'Salesforce Sans', -apple-system, 'Segoe UI', Roboto, sans-serif; color: #181818;
--sla-blue: #0176D3; --sla-blue-soft: color-mix(in srgb, #0176D3 8%, #FFFFFF); --sla-navy: #0B5CAB;
--sla-muted: #706E6B; --sla-border: #DDDBDA; --sla-card: #FFFFFF; }
@media (prefers-color-scheme: dark) { .sla-root { color: #F3F3F3;
--sla-blue: #0D9DDA; --sla-blue-soft: color-mix(in srgb, #0D9DDA 16%, #232323); --sla-navy: #0B5CAB;
--sla-muted: #A5A5A5; --sla-border: #474747; --sla-card: #232323; } }
.sla-header { display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem;
max-inline-size: 46rem; margin-inline: auto; border: 1px solid var(--sla-border);
border-radius: .25rem .25rem 0 0; border-block-end: 0; background: var(--sla-navy); color: #FFFFFF; }
.sla-waffle { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5px; padding: .45rem;
border: 0; border-radius: .25rem; background: transparent; color: #FFFFFF; cursor: pointer; }
.sla-waffle[aria-expanded='true'] { background: color-mix(in srgb, #FFFFFF 22%, transparent); }
.sla-waffle i { inline-size: 3.5px; aspect-ratio: 1; border-radius: 50%; background: currentColor; }
.sla-breadcrumb { font-size: .85rem; opacity: .92; }
.sla-search-head { margin-inline-start: auto; font-size: .8rem; opacity: .9; }
.sla-panel { max-inline-size: 46rem; margin-inline: auto; border: 1px solid var(--sla-border);
border-radius: 0 0 .25rem .25rem; background: var(--sla-card); overflow: clip; }
.sla-search { display: flex; align-items: center; gap: .5rem; padding: .65rem .9rem;
border-block-end: 1px solid var(--sla-border); }
.sla-search .nx-icon { color: var(--sla-muted); }
.sla-search input { flex: 1; min-inline-size: 0; padding: .45rem .6rem; border: 1px solid var(--sla-border);
border-radius: .25rem; background: var(--sla-card); color: inherit; font: inherit; font-size: .85rem; }
.sla-body { max-block-size: 21rem; overflow-y: auto; padding: .35rem .9rem 0; }
.sla-section h3 { margin: .6rem 0 .4rem; font-size: .8rem; font-weight: 700; color: var(--sla-muted);
display: flex; align-items: center; gap: .5rem; }
.sla-section h3::after { content: ''; flex: 1; block-size: 1px; background: var(--sla-border); }
.sla-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
gap: .4rem; padding-block-end: .6rem; }
.sla-app { display: grid; justify-items: center; gap: .35rem; padding: .6rem .35rem; border: 0;
border-radius: .25rem; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.sla-app:hover { background: var(--sla-blue-soft); }
.sla-tile { display: grid; place-items: center; inline-size: 2.6rem; block-size: 2.6rem; border-radius: .25rem;
background: var(--sla-tint, var(--sla-navy)); color: #FFFFFF; font-size: 1.15rem; font-weight: 700; }
.sla-app span { max-inline-size: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
font-size: .76rem; font-weight: 600; }
.sla-empty { padding: 1.4rem 0 1.6rem; text-align: center; color: var(--sla-muted); font-size: .85rem; }
.sla-foot { display: flex; justify-content: center; border-block-start: 1px solid var(--sla-border); padding: .55rem; }
.sla-foot button { border: 0; background: transparent; color: var(--sla-blue); font: inherit;
font-size: .8rem; font-weight: 600; cursor: pointer; }
`;
<!-- AppLauncher.vue — the famous 3×3 waffle in a Lightning header opening
the app panel: live search, colour tiles with initials, honest counts,
Escape to close. Markup mirrors the playground partial (sla-* classes). -->
<script setup lang="ts">
import { computed, ref } from 'vue';
const apps = [
{ label: 'Sales', initial: 'S', tint: '#0B5CAB' },
{ label: 'Service', initial: 'S', tint: '#0176D3' },
{ label: 'Marketing', initial: 'M', tint: '#B32D69' },
{ label: 'Chatter', initial: 'C', tint: '#04844B' },
{ label: 'Reports', initial: 'R', tint: '#FE9339' },
{ label: 'Dashboards', initial: 'D', tint: '#6739B7' },
{ label: 'Tasks', initial: 'T', tint: '#0B827C' },
{ label: 'Notes', initial: 'N', tint: '#BA0517' },
];
const open = ref(true);
const q = ref('');
const matches = computed(() =>
apps.filter((a) => a.label.toLowerCase().includes(q.value.trim().toLowerCase())));
</script>
<template>
<div class="sla-root" @keydown.escape="open = false">
<div>
<div class="sla-header">
<button type="button" class="sla-waffle" :aria-expanded="open"
aria-label="Open the app launcher" @click="open = !open">
<i v-for="dot in 9" :key="dot" />
</button>
<span class="sla-breadcrumb">Sales / Opportunity: Nabu annual license</span>
<span class="sla-search-head">Search…</span>
</div>
<div v-if="open" class="sla-panel" role="dialog" aria-label="App launcher">
<div class="sla-search">
<input v-model="q" type="search" placeholder="Find an app…" aria-label="Search apps" />
</div>
<div class="sla-body">
<section class="sla-section">
<h3>All items · {{ matches.length }}</h3>
<div class="sla-grid">
<button v-for="a in matches" :key="a.label" type="button" class="sla-app"
:style="{ '--sla-tint': a.tint }">
<span class="sla-tile" aria-hidden="true">{{ a.initial }}</span>
<span>{{ a.label }}</span>
</button>
</div>
<p v-if="matches.length === 0" class="sla-empty">No app matches — try "Sales".</p>
</section>
</div>
<div class="sla-foot"><button type="button">All apps →</button></div>
</div>
</div>
</div>
</template>
<style scoped>
.sla-root { font-family: 'Salesforce Sans', -apple-system, 'Segoe UI', Roboto, sans-serif; color: #181818;
--sla-blue: #0176D3; --sla-blue-soft: color-mix(in srgb, #0176D3 8%, #FFFFFF); --sla-navy: #0B5CAB;
--sla-muted: #706E6B; --sla-border: #DDDBDA; --sla-card: #FFFFFF; }
@media (prefers-color-scheme: dark) { .sla-root { color: #F3F3F3;
--sla-blue: #0D9DDA; --sla-blue-soft: color-mix(in srgb, #0D9DDA 16%, #232323); --sla-navy: #0B5CAB;
--sla-muted: #A5A5A5; --sla-border: #474747; --sla-card: #232323; } }
.sla-header { display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem;
max-inline-size: 46rem; margin-inline: auto; border: 1px solid var(--sla-border);
border-radius: .25rem .25rem 0 0; border-block-end: 0; background: var(--sla-navy); color: #FFFFFF; }
.sla-waffle { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5px; padding: .45rem;
border: 0; border-radius: .25rem; background: transparent; color: #FFFFFF; cursor: pointer; }
.sla-waffle[aria-expanded='true'] { background: color-mix(in srgb, #FFFFFF 22%, transparent); }
.sla-waffle i { inline-size: 3.5px; aspect-ratio: 1; border-radius: 50%; background: currentColor; }
.sla-breadcrumb { font-size: .85rem; opacity: .92; }
.sla-search-head { margin-inline-start: auto; font-size: .8rem; opacity: .9; }
.sla-panel { max-inline-size: 46rem; margin-inline: auto; border: 1px solid var(--sla-border);
border-radius: 0 0 .25rem .25rem; background: var(--sla-card); overflow: clip; }
.sla-search { display: flex; align-items: center; gap: .5rem; padding: .65rem .9rem;
border-block-end: 1px solid var(--sla-border); }
.sla-search input { flex: 1; min-inline-size: 0; padding: .45rem .6rem; border: 1px solid var(--sla-border);
border-radius: .25rem; background: var(--sla-card); color: inherit; font: inherit; font-size: .85rem; }
.sla-body { max-block-size: 21rem; overflow-y: auto; padding: .35rem .9rem 0; }
.sla-section h3 { margin: .6rem 0 .4rem; font-size: .8rem; font-weight: 700; color: var(--sla-muted);
display: flex; align-items: center; gap: .5rem; }
.sla-section h3::after { content: ''; flex: 1; block-size: 1px; background: var(--sla-border); }
.sla-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
gap: .4rem; padding-block-end: .6rem; }
.sla-app { display: grid; justify-items: center; gap: .35rem; padding: .6rem .35rem; border: 0;
border-radius: .25rem; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.sla-app:hover { background: var(--sla-blue-soft); }
.sla-tile { display: grid; place-items: center; inline-size: 2.6rem; block-size: 2.6rem; border-radius: .25rem;
background: var(--sla-tint, var(--sla-navy)); color: #FFFFFF; font-size: 1.15rem; font-weight: 700; }
.sla-app span { max-inline-size: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
font-size: .76rem; font-weight: 600; }
.sla-empty { padding: 1.4rem 0 1.6rem; text-align: center; color: var(--sla-muted); font-size: .85rem; }
.sla-foot { display: flex; justify-content: center; border-block-start: 1px solid var(--sla-border); padding: .55rem; }
.sla-foot button { border: 0; background: transparent; color: var(--sla-blue); font: inherit;
font-size: .8rem; font-weight: 600; cursor: pointer; }
</style>
<!-- AppLauncher.svelte — the famous 3×3 waffle in a Lightning header opening
the app panel: live search, colour tiles with initials, honest counts,
Escape to close. Markup mirrors the playground partial (sla-* classes). -->
<script lang="ts">
const apps = [
{ label: 'Sales', initial: 'S', tint: '#0B5CAB' },
{ label: 'Service', initial: 'S', tint: '#0176D3' },
{ label: 'Marketing', initial: 'M', tint: '#B32D69' },
{ label: 'Chatter', initial: 'C', tint: '#04844B' },
{ label: 'Reports', initial: 'R', tint: '#FE9339' },
{ label: 'Dashboards', initial: 'D', tint: '#6739B7' },
{ label: 'Tasks', initial: 'T', tint: '#0B827C' },
{ label: 'Notes', initial: 'N', tint: '#BA0517' },
];
let open = $state(true);
let q = $state('');
const matches = $derived(apps.filter((a) => a.label.toLowerCase().includes(q.trim().toLowerCase())));
</script>
<svelte:window onkeydown={(e) => e.key === 'Escape' && (open = false)} />
<div class="sla-root">
<div>
<div class="sla-header">
<button type="button" class="sla-waffle" aria-expanded={open}
aria-label="Open the app launcher" onclick={() => (open = !open)}>
{#each { length: 9 } as _, i (i)}<i></i>{/each}
</button>
<span class="sla-breadcrumb">Sales / Opportunity: Nabu annual license</span>
<span class="sla-search-head">Search…</span>
</div>
{#if open}
<div class="sla-panel" role="dialog" aria-label="App launcher">
<div class="sla-search">
<input bind:value={q} type="search" placeholder="Find an app…" aria-label="Search apps" />
</div>
<div class="sla-body">
<section class="sla-section">
<h3>All items · {matches.length}</h3>
<div class="sla-grid">
{#each matches as a (a.label)}
<button type="button" class="sla-app" style:--sla-tint={a.tint}>
<span class="sla-tile" aria-hidden="true">{a.initial}</span>
<span>{a.label}</span>
</button>
{/each}
</div>
{#if matches.length === 0}
<p class="sla-empty">No app matches — try "Sales".</p>
{/if}
</section>
</div>
<div class="sla-foot"><button type="button">All apps →</button></div>
</div>
{/if}
</div>
</div>
<style>
.sla-root { font-family: 'Salesforce Sans', -apple-system, 'Segoe UI', Roboto, sans-serif; color: #181818;
--sla-blue: #0176D3; --sla-blue-soft: color-mix(in srgb, #0176D3 8%, #FFFFFF); --sla-navy: #0B5CAB;
--sla-muted: #706E6B; --sla-border: #DDDBDA; --sla-card: #FFFFFF; }
@media (prefers-color-scheme: dark) { .sla-root { color: #F3F3F3;
--sla-blue: #0D9DDA; --sla-blue-soft: color-mix(in srgb, #0D9DDA 16%, #232323); --sla-navy: #0B5CAB;
--sla-muted: #A5A5A5; --sla-border: #474747; --sla-card: #232323; } }
.sla-header { display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem;
max-inline-size: 46rem; margin-inline: auto; border: 1px solid var(--sla-border);
border-radius: .25rem .25rem 0 0; border-block-end: 0; background: var(--sla-navy); color: #FFFFFF; }
.sla-waffle { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5px; padding: .45rem;
border: 0; border-radius: .25rem; background: transparent; color: #FFFFFF; cursor: pointer; }
.sla-waffle[aria-expanded='true'] { background: color-mix(in srgb, #FFFFFF 22%, transparent); }
.sla-waffle i { inline-size: 3.5px; aspect-ratio: 1; border-radius: 50%; background: currentColor; }
.sla-breadcrumb { font-size: .85rem; opacity: .92; }
.sla-search-head { margin-inline-start: auto; font-size: .8rem; opacity: .9; }
.sla-panel { max-inline-size: 46rem; margin-inline: auto; border: 1px solid var(--sla-border);
border-radius: 0 0 .25rem .25rem; background: var(--sla-card); overflow: clip; }
.sla-search { display: flex; align-items: center; gap: .5rem; padding: .65rem .9rem;
border-block-end: 1px solid var(--sla-border); }
.sla-search input { flex: 1; min-inline-size: 0; padding: .45rem .6rem; border: 1px solid var(--sla-border);
border-radius: .25rem; background: var(--sla-card); color: inherit; font: inherit; font-size: .85rem; }
.sla-body { max-block-size: 21rem; overflow-y: auto; padding: .35rem .9rem 0; }
.sla-section h3 { margin: .6rem 0 .4rem; font-size: .8rem; font-weight: 700; color: var(--sla-muted);
display: flex; align-items: center; gap: .5rem; }
.sla-section h3::after { content: ''; flex: 1; block-size: 1px; background: var(--sla-border); }
.sla-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
gap: .4rem; padding-block-end: .6rem; }
.sla-app { display: grid; justify-items: center; gap: .35rem; padding: .6rem .35rem; border: 0;
border-radius: .25rem; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.sla-app:hover { background: var(--sla-blue-soft); }
.sla-tile { display: grid; place-items: center; inline-size: 2.6rem; block-size: 2.6rem; border-radius: .25rem;
background: var(--sla-tint, var(--sla-navy)); color: #FFFFFF; font-size: 1.15rem; font-weight: 700; }
.sla-app span { max-inline-size: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
font-size: .76rem; font-weight: 600; }
.sla-empty { padding: 1.4rem 0 1.6rem; text-align: center; color: var(--sla-muted); font-size: .85rem; }
.sla-foot { display: flex; justify-content: center; border-block-start: 1px solid var(--sla-border); padding: .55rem; }
.sla-foot button { border: 0; background: transparent; color: var(--sla-blue); font: inherit;
font-size: .8rem; font-weight: 600; cursor: pointer; }
</style>