# Notch island (Notchset): prompt.md (v2.0.0)

- id: `notch-island` · version 2.0.0 · block · free
- category: Marketing
- build: one set of files for every shadcn style
- install: `npx shadcn@latest add https://notchset.dev/r/notch-island.json`
- npm dependencies: none
- registry dependencies: utils, https://notchset.dev/r/notchset-foundation.json
- docs: https://notchset.dev/blocks/notch-island
- The install command carries everything this item needs (files, CSS, tokens, npm and registry dependencies). Prefer it to copying source by hand.

A small dark island at the top of a screen that reshapes to hold what just happened: a call coming in, a file going up, a thing done. The shape changes first and the words arrive a beat after..

## Build it
- Stack: React 18.3 or 19, TypeScript, Tailwind CSS v4 utility classes on the foundation's roles, a components.json (imports use its aliases).
- Packages: none beyond React.
- Files: `components/ui/notchset/blocks/notch-island.tsx`.
- Registry dependencies, installed with it automatically: shadcn `utils` (cn), `notchset-foundation`.
- Builds: one set of files, the same for every shadcn style.
- Exports to keep: `NotchIsland`, and every exported type.
- CSS: the install adds the notchset foundation (its roles, keyframes and motion switch, reading your shadcn tokens for colour) to your global stylesheet once. Nothing to import by hand.
- Re-running `add` (or `--overwrite`) re-applies those rules: put overrides in your own CSS, never in the installed rules.
- Colours: every part reads the foundation's roles (`--ns-canvas`, `--ns-ink`, `--ns-line`, `--ns-signal` …), which read your shadcn tokens (`--background`, `--foreground`, `--border`, `--destructive` …), plus the optional `--success` and `--warning`. Retheme on `:root` or any container; never add Tailwind colour classes inside the component.
- This item reads `--ns-ease`, `--ns-ease-panel`, `--ns-ink`, `--ns-ink-2`, `--ns-line`, `--ns-panel`, `--ns-signal`, `--ns-text-body`, `--ns-text-meta`, `--ns-text-small`, `--ns-time-color`, `--ns-time-dialog`, `--ns-time-page`, `--ns-weight-medium`.
- Retune it (on any ancestor) with the foundation's roles and hooks: `--ns-bad`, `--ns-bad-ink`, `--ns-band`, `--ns-band-edge`, `--ns-band-grade`, `--ns-band-optimal`, `--ns-beat`, `--ns-bezel`, `--ns-canvas`, `--ns-cat-1`, `--ns-cat-2`, `--ns-cat-3`, `--ns-cat-4`, `--ns-cat-5`, `--ns-cat-6`, `--ns-check`, `--ns-chip`, `--ns-control`, `--ns-control-pad`, `--ns-control-sm`, `--ns-deep`, `--ns-deep-ink`, `--ns-deep-ink-2`, `--ns-deep-line`, `--ns-dialog`, `--ns-dialog-lg`, `--ns-dialog-sm`, `--ns-ease`, `--ns-ease-in`, `--ns-ease-panel`, `--ns-ease-pop`, `--ns-field`, `--ns-flood-arc`, `--ns-flood-aurora`, `--ns-flood-behind-1`, `--ns-flood-behind-2`, `--ns-flood-bloom`, `--ns-flood-deep`, `--ns-flood-dial-bloom`, `--ns-flood-glass`, `--ns-flood-grain`, `--ns-flood-image`, `--ns-flood-ink`, `--ns-flood-ink-low`, `--ns-flood-light`, `--ns-flood-mid`, `--ns-flood-pale`, `--ns-flood-pane`, `--ns-flood-pane-edge`, `--ns-flood-pill-ink`, `--ns-flood-ribbon`, `--ns-flood-ribbon-core`, `--ns-flood-shadow`, `--ns-flood-sheen`, `--ns-flood-wash`, `--ns-font-body`, `--ns-font-display`, `--ns-font-mono`, `--ns-font-script`, `--ns-glass`, `--ns-glass-blur`, `--ns-glass-shadow`, `--ns-glow`, `--ns-grain`, `--ns-gutter`, `--ns-header`, `--ns-heat`, `--ns-hover`, `--ns-ink`, `--ns-ink-2`, `--ns-ink-3`, `--ns-ink-4`, `--ns-leading`, `--ns-lift`, `--ns-light-1`, `--ns-light-2`, `--ns-light-3`, `--ns-light-spread`, `--ns-light-strength`, `--ns-line`, `--ns-line-soft`, `--ns-lit-edge`, `--ns-menu-dy`, `--ns-menu-row`, `--ns-mesh`, `--ns-mesh-frost`, `--ns-ok`, `--ns-ok-ink`, `--ns-orb-body`, `--ns-orb-cool`, `--ns-orb-core`, `--ns-orb-dawn`, `--ns-orb-deep`, `--ns-orb-edge`, `--ns-orb-grain`, `--ns-orb-ground`, `--ns-orb-halo`, `--ns-orb-inner`, `--ns-orb-key`, `--ns-orb-lift`, `--ns-orb-limb`, `--ns-orb-limb-from`, `--ns-orb-rim`, `--ns-orb-skin-hi`, `--ns-orb-skin-lo`, `--ns-orb-skin-mid`, `--ns-orb-warm`, `--ns-panel`, `--ns-panel-w`, `--ns-prism-edge`, `--ns-prism-glint`, `--ns-prism-sheen`, `--ns-prism-tint`, `--ns-pulse`, `--ns-radius`, `--ns-radius-card`, `--ns-radius-full`, `--ns-radius-lg`, `--ns-radius-sm`, `--ns-radius-xl`, `--ns-raised`, `--ns-range`, `--ns-row`, `--ns-row-compact`, `--ns-segment`, `--ns-selected`, `--ns-series`, `--ns-series-core`, `--ns-series-lilac`, `--ns-series-tint`, `--ns-shadow-dialog`, `--ns-shadow-float`, `--ns-shadow-panel`, `--ns-sheet`, `--ns-sheet-bottom`, `--ns-side`, `--ns-signal`, `--ns-sleep-awake`, `--ns-sleep-deep`, `--ns-sleep-light`, `--ns-sleep-rem`, `--ns-space-1`, `--ns-space-2`, `--ns-space-3`, `--ns-space-4`, `--ns-space-5`, `--ns-space-6`, `--ns-space-8`, `--ns-space-section`, `--ns-stack-on`, `--ns-standing-critical`, `--ns-standing-in`, `--ns-standing-out`, `--ns-state-doing`, `--ns-state-done`, `--ns-state-review`, `--ns-state-todo`, `--ns-switch-h`, `--ns-switch-w`, `--ns-text-body`, `--ns-text-control`, `--ns-text-display`, `--ns-text-figure`, `--ns-text-headline`, `--ns-text-hero`, `--ns-text-lede`, `--ns-text-meta`, `--ns-text-page`, `--ns-text-record`, `--ns-text-small`, `--ns-text-strong`, `--ns-text-sub`, `--ns-text-title`, `--ns-tile-shadow`, `--ns-time-born`, `--ns-time-color`, `--ns-time-dialog`, `--ns-time-menu`, `--ns-time-page`, `--ns-time-panel`, `--ns-time-toast`, `--ns-tint`, `--ns-tint-ink`, `--ns-toast-bottom`, `--ns-toast-left`, `--ns-touch`, `--ns-tracking-display`, `--ns-tracking-headline`, `--ns-warn`, `--ns-warn-ink`, `--ns-wash-clay`, `--ns-wash-dusk`, `--ns-wash-graphite`, `--ns-wash-ink`, `--ns-wash-sage`, `--ns-wash-sand`, `--ns-weight-light`, `--ns-weight-medium`, `--ns-weight-regular`, `--ns-weight-strong`, `--ns-well`.
- Never add Tailwind colour classes inside the component.

```tsx
import { NotchIsland, type IslandMoment } from "@/components/ui/notchset/blocks/notch-island";
```

## Parts
- A single export that takes props.

## Match the original
- Read `components/ui/notchset/blocks/notch-island.tsx` as the reference implementation before changing or recreating anything, and match it: sizes, colours per theme, motion timings, copy and behaviour.
- If you deviate (a prop you can't honour, a style you changed, a dependency you swapped), say so in your reply, part by part.
- Keep the accessibility contract, the keyboard map and the motion levels listed below.

## Use it when

### Not when

## Mistakes
- Recreating the component instead of installing it

## Usage

```tsx
"use client";
import * as React from "react";
import { Check, FileUp, Phone, PhoneOff } from "lucide-react";
import { NotchIsland, type IslandMoment } from "@/components/ui/notchset/blocks/notch-island";
import { Avatar } from "@/components/ui/notchset/avatar";

const round = (bg: string, icon: React.ReactNode, label: string) => (
  <span role="img" aria-label={label} className={`grid size-8 place-items-center rounded-full ${bg} [&_svg]:size-4`}>
    {icon}
  </span>
);

export default function NotchIslandDemo() {
  const [at, setAt] = React.useState("call");
  const [pct, setPct] = React.useState(0);
  /* the upload really goes up, then lands as done */
  React.useEffect(() => {
    if (at !== "upload") return;
    const t = setInterval(() => setPct((p) => Math.min(1, p + 0.06)), 140);
    return () => clearInterval(t);
  }, [at]);
  React.useEffect(() => {
    if (at !== "upload" || pct < 1) return;
    const t = setTimeout(() => setAt("done"), 420);
    return () => clearTimeout(t);
  }, [at, pct]);
  const moments: IslandMoment[] = [
    { key: "rest", label: "Quiet", size: "rest" },
    {
      key: "call",
      label: "Call",
      size: "wide",
      lead: <Avatar name="Ana Ruiz" size={32} />,
      title: "Ana Ruiz",
      detail: "Discovery call",
      trail: (
        <span className="flex gap-2 text-white">
          {round("bg-[var(--ns-bad)]", <PhoneOff />, "Decline")}
          {round("bg-[var(--ns-ok)]", <Phone />, "Answer")}
        </span>
      ),
    },
    {
      key: "upload",
      label: "Upload",
      size: "tall",
      lead: (
        <span className="grid size-9 place-items-center rounded-[10px] bg-white/10 [&_svg]:size-4">
          <FileUp />
        </span>
      ),
      title: "Q4 pricing deck.pdf",
      detail: `${Math.round(pct * 100)}% · to Stripe`,
      progress: pct,
    },
    {
      key: "done",
      label: "Done",
      size: "wide",
      lead: (
        <span className="grid size-8 place-items-center rounded-full bg-[var(--ns-ok)] text-white [&_svg]:size-4">
          <Check />
        </span>
      ),
      title: "Sent to Stripe",
      detail: "Priya will see it in her inbox",
    },
  ];
  return (
    <NotchIsland
      moments={moments}
      value={at}
      onValueChange={(k) => {
        if (k === "upload") setPct(0.08);
        setAt(k);
      }}
    />
  );
}
```

This example also uses `avatar` (https://notchset.dev/components/avatar), the npm package `lucide-react`. Installing this item doesn't bring them; to paste the example as it is: `npx shadcn@latest add https://notchset.dev/r/notch-island.json https://notchset.dev/r/avatar.json`.

## Props

| Prop | Type | Default | What it does |
|---|---|---|---|
| `moments` | `IslandMoment[]` |  | Required. |
| `value` | `string` |  | Required. |
| `onValueChange` | `(key: string) => void` |  | Required. |
| `picker` | `boolean` | `true` | the chips under the island that pick a moment; on by default |

Full docs: https://notchset.dev/blocks/notch-island

## Customising
- Colours: every part reads the foundation's roles (`--ns-canvas`, `--ns-ink`, `--ns-line`, `--ns-signal` …), which read your shadcn tokens (`--background`, `--foreground`, `--border`, `--destructive` …), plus the optional `--success` and `--warning`. Retheme on `:root` or any container; never add Tailwind colour classes inside the component.
- Dark mode follows the `.dark` class or `data-theme="dark"` on an ancestor (the shadcn and next-themes conventions).
- Update later: Commit or stash local changes first (or copy the files), so the update can be undone. Read https://notchset.dev/r/changelog.json for the new versions: a major version, an entry marked breaking or a merge says what to change. Then re-run the install with `--overwrite`, on a branch. It replaces the component's files, the shared helper files they import, and the item's CSS rules in the global stylesheet, so review the whole diff (components, shared files, CSS), re-apply your own edits, and run the app's typecheck, tests and build.

## Accessibility contract (preserve when editing)

## Install

```bash
npx shadcn@latest add https://notchset.dev/r/notch-island.json
```

Or add the `@notchset` registry to components.json and run `npx shadcn@latest add @notchset/notch-island`. Every components.json style gets the same files.

## Source

### components/ui/notchset/blocks/notch-island.tsx

```tsx
// Notchset notch-island 2.0.0 · https://notchset.dev/changelog
"use client";
import * as React from "react";
import { cn } from "@/lib/utils";

/*
 * Notch island: a small dark island at the top of a screen that reshapes to hold what just happened: a call
 * coming in, a file going up, a thing done. Its size follows its content (rest, wide, tall); the shape changes
 * first and the words arrive a beat after, so the eye follows the shape and then reads. Pressing it shows the next
 * moment. One live region says what the island now holds. Reduced motion lands each shape at once.
 *
 * The host owns the value. A value that names no moment (or no moments yet, while they load) leaves the island at
 * rest with no chip picked, saying "Nothing selected" (or "Nothing happening"): it never shows another moment as if
 * the host had chosen it. Pressing it then asks for the first moment; with no moments it can't be pressed.
 *
 *   <NotchIsland moments={[{ key: "rest", label: "Quiet", size: "rest" }, { key: "call", label: "Call", size: "wide",
 *     lead: <Avatar …/>, title: "Ana Ruiz", detail: "Discovery call · Raycast" }]} value={k} onValueChange={setK} />
 */
type IslandMoment = {
  key: string;
  /** what the moment is, in a word (the chip under the island, and what a screen reader hears) */
  label: string;
  size: "rest" | "wide" | "tall";
  lead?: React.ReactNode;
  title?: React.ReactNode;
  detail?: React.ReactNode;
  trail?: React.ReactNode;
  /** 0–1: a progress line along the island's lower edge */
  progress?: number | undefined;
};
type NotchIslandProps = {
  moments: IslandMoment[];
  value: string;
  onValueChange: (key: string) => void;
  /** the chips under the island that pick a moment; on by default */
  picker?: boolean;
  className?: string | undefined;
};

const SIZE: Record<IslandMoment["size"], string> = {
  rest: "w-[7.5rem] h-[2.125rem] rounded-[1.0625rem]",
  wide: "w-[min(100%,22.5rem)] h-14 rounded-[1.75rem]",
  tall: "w-[min(100%,22.5rem)] h-[7.5rem] rounded-[1.875rem]",
};

function NotchIsland({ moments, value, onValueChange, picker = true, className }: NotchIslandProps) {
  const i = moments.findIndex((x) => x.key === value);
  const m: IslandMoment = moments[i] ?? { key: "", label: moments.length ? "Nothing selected" : "Nothing happening", size: "rest" };
  const next = moments.length ? moments[(i + 1) % moments.length]! : null;
  const group = React.useRef<HTMLDivElement>(null);
  /* a radio group's keys: one tab stop (the chosen moment), arrows and Home/End choose and move focus with it */
  const onKey = (e: React.KeyboardEvent) => {
    if (!moments.length) return;
    const cur = Math.max(0, i);
    const step = e.key === "ArrowRight" || e.key === "ArrowDown" ? 1 : e.key === "ArrowLeft" || e.key === "ArrowUp" ? -1 : 0;
    const to = e.key === "Home" ? 0 : e.key === "End" ? moments.length - 1 : step ? (cur + step + moments.length) % moments.length : -1;
    if (to < 0) return;
    e.preventDefault();
    onValueChange(moments[to]!.key);
    group.current?.querySelectorAll<HTMLElement>("[role=radio]")[to]?.focus();
  };
  return (
    <div data-slot="notch-island" className={cn("flex w-full flex-col items-center gap-4", className)}>
      <button
        type="button"
        onClick={() => next && onValueChange(next.key)}
        disabled={!next}
        aria-label={next ? `${m.label}. Show ${next.label.toLowerCase()}` : m.label}
        data-ns-glide=""
        className={cn(
          "relative flex cursor-pointer items-center disabled:cursor-default overflow-hidden bg-[#08080a] text-left text-white shadow-[0_0_0_1px_rgb(255_255_255/0.06),0_18px_40px_-16px_rgb(0_0_0/0.55)] outline-hidden [transition:width_var(--ns-time-page)_var(--ns-ease-panel),height_var(--ns-time-page)_var(--ns-ease-panel),border-radius_var(--ns-time-page)_var(--ns-ease-panel)] focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-[var(--ns-signal)]",
          SIZE[m.size],
        )}
      >
        {/* the content arrives a beat after the shape, so the change reads as one movement */}
        <span key={m.key} data-ns-moves="" className={cn("flex min-w-0 flex-1 gap-3 px-4 [animation:ns-island-in_var(--ns-time-dialog)_var(--ns-ease)_120ms_both]", m.size === "tall" ? "flex-col justify-center py-4" : "items-center")}>
          {m.size === "rest" ? (
            <span aria-hidden className="mx-auto flex items-center gap-1.5">
              <i className="size-1.5 rounded-full bg-white/80" />
              <i className="h-1.5 w-8 rounded-full bg-white/20" />
            </span>
          ) : (
            <>
              <span className="flex min-w-0 items-center gap-3">
                {m.lead && <span className="shrink-0">{m.lead}</span>}
                <span className="flex min-w-0 flex-1 flex-col">
                  {m.title && <span className="truncate text-[length:var(--ns-text-body)] font-[number:var(--ns-weight-medium)]">{m.title}</span>}
                  {m.detail && <span className="truncate text-[length:var(--ns-text-small)] text-white/60">{m.detail}</span>}
                </span>
                {m.trail && <span className="shrink-0">{m.trail}</span>}
              </span>
            </>
          )}
        </span>
        {m.progress != null && (
          <span aria-hidden className="absolute inset-x-5 bottom-2 h-[3px] overflow-hidden rounded-full bg-white/15">
            <i data-ns-glide="" className="block h-full rounded-full bg-white [transition:width_var(--ns-time-dialog)_var(--ns-ease)]" style={{ width: `${Math.round(m.progress * 100)}%` }} />
          </span>
        )}
      </button>
      <span aria-live="polite" className="sr-only">
        {m.label}
        {m.progress != null ? `, ${Math.round(m.progress * 100)}%` : ""}
      </span>
      {picker && (
        <div ref={group} role="radiogroup" aria-label="Island moments" onKeyDown={onKey} className="flex flex-wrap justify-center gap-1">
          {moments.map((x) => (
            <button
              key={x.key}
              type="button"
              role="radio"
              data-value={x.key}
              aria-checked={i >= 0 && x.key === m.key}
              tabIndex={x.key === (i >= 0 ? m.key : moments[0]?.key) ? 0 : -1}
              onClick={() => onValueChange(x.key)}
              className="cursor-pointer rounded-full px-2.5 py-1 text-[length:var(--ns-text-meta)] text-[var(--ns-ink-2)] outline-hidden [transition:background-color_var(--ns-time-color),color_var(--ns-time-color)] hover:text-[var(--ns-ink)] focus-visible:outline-2 focus-visible:outline-[var(--ns-signal)] aria-checked:bg-[var(--ns-panel)] aria-checked:text-[var(--ns-ink)] aria-checked:shadow-[0_0_0_1px_var(--ns-line)]"
            >
              {x.label}
            </button>
          ))}
        </div>
      )}
    </div>
  );
}

export { NotchIsland, type IslandMoment, type NotchIslandProps };
```

The foundation (the tokens listed above, keyframes and motion levels) installs once with the first component; its CSS is public at https://notchset.dev/r/notchset-foundation.json.
