BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/moco/island

Island

moco/island
FreeComponent

Morphing sticky header for long reads: progress ring, scrollspy section, section menu, and a Read-next end phase.

Live preview

live · rendered by the registry
Rendered by moco on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://mocoui.site/r/island.json

Source

registry/island/island.tsxmocoui.site/r/island.json · first 6 KB
1"use client";
2
3import * as React from "react";
4import "./island.css";
5import {
6 useReadProgress,
7 useScrollspy,
8 useReducedMotion,
9 smoothScrollTo,
10} from "@/components/moco/hooks";
11
12export interface Heading {
13 id: string;
14 text: string;
15 level?: number;
16}
17
18export interface IslandLink {
19 label: string;
20 href: string;
21}
22
23export interface IslandProps {
24 title: string;
25 headings: Heading[];
26 /** Minutes. Shown at the top and counted down by the progress ring. */
27 readingTime: number;
28 /** Home / wordmark link shown while reading. */
29 brand: IslandLink;
30 /** Extra links listed under "Elsewhere" in the section menu. */
31 links: IslandLink[];
32 /** "Read next →" target. The end phase is skipped when absent. */
33 next?: IslandLink | null;
34 /** CSS selector for the article element progress is measured against. */
35 articleSelector?: string;
36}
37
38/**
39 * The morphing header island. Compact at scroll 0; expands to reveal the post
40 * title, a scrollspy section name and a progress ring as you read; morphs once
41 * more into "Read next →" at the end.
42 */
43export function Island({
44 title,
45 headings,
46 readingTime,
47 brand,
48 links,
49 next,
50 articleSelector = "#article-root",
51}: IslandProps) {
52 const ids = React.useMemo(() => headings.map((h) => h.id), [headings]);
53 const progress = useReadProgress(articleSelector);
54 const active = useScrollspy(ids);
55 const reduced = useReducedMotion();
56
57 const [open, setOpen] = React.useState(false);
58 const [entered, setEntered] = React.useState(false);
59 const [width, setWidth] = React.useState<number | undefined>();
60 const inner = React.useRef<HTMLDivElement>(null);
61 const shell = React.useRef<HTMLDivElement>(null);
62
63 const phase: "top" | "reading" | "end" =
64 progress <= 0.02 ? "top" : progress >= 0.94 && next ? "end" : "reading";
65
66 // Re-measure the content and animate the shell to it.
67 React.useLayoutEffect(() => {
68 const el = inner.current;
69 if (!el) return;
70 const measure = () => setWidth(el.scrollWidth);
71 measure();
72 const ro = new ResizeObserver(measure);
73 ro.observe(el);
74 return () => ro.disconnect();
75 }, [phase, active, title, next]);
76
77 // Slide + fade the swapped text in.
78 React.useEffect(() => {
79 if (reduced) {
80 setEntered(true);
81 return;
82 }
83 setEntered(false);
84 const t = requestAnimationFrame(() => setEntered(true));
85 return () => cancelAnimationFrame(t);
86 }, [phase, reduced]);
87
88 React.useEffect(() => {
89 if (!open) return;
90// … truncated

What it pulls in

Other registry items

  • https://mocoui.site/r/tokens.json
  • https://mocoui.site/r/hooks.json

Files it writes

  • registry/island/island.tsx
  • registry/island/island.css

Facts

Registry
moco
Type
registry:component
Access
Free
Files written
2
Licence
MIT
In the index
at or before 2026-08-16
Last confirmed
today

Go to the source

Docs on moco mocoui.site shreya0204/moco on GitHub Raw registry item This item as JSON

More from moco

All 20 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
CodecodemocoComponentsFree1 dep · 3 files
ComparecomparemocoComponentsFreeno deps · 2 files
Count UpcountupmocoComponentsFreeno deps · 2 files
CovercovermocoComponentsFreeno deps · 2 files
Diagram KitdiagrammocoComponentsFreeno deps · 2 files
Dot GriddotgridmocoComponentsFreeno deps · 2 files
FigurefiguremocoComponentsFreeno deps · 2 files
HookshooksmocoComponentsFreeno deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex