BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/ns-ui/context-prompt-shims
This component no longer exists. It was in ns-ui’s manifest when we first indexed it and is not there now — the registry served its inventory on 2026-08-07 and this item was not on it. The install command below will fail. It is kept here because a tutorial somewhere still tells people to run it.

Context Prompt Shims

ns-ui/context-prompt-shims
RemovedComponent

Prompt composition rendered as machinist shims fitted into a fixed-height gap: each section's row height maps to its real token count, order is drag/keyboard reorderable with FLIP transforms, and an over-budget insert compresses the stack, bounces back to the tray, and surfaces a truncation remedy instead of an error string.

Live preview

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

Install it

npx shadcn@latest add https://design.helpmarq.com/r/context-prompt-shims.json

Source

registry/core/context-prompt-shims/component.tsxdesign.helpmarq.com/r/context-prompt-shims.json · first 6 KB
1"use client";
2
3import {
4 useCallback,
5 useEffect,
6 useId,
7 useMemo,
8 useRef,
9 useState,
10 type KeyboardEvent as ReactKeyboardEvent,
11 type PointerEvent as ReactPointerEvent,
12} from "react";
13
14// ---------------------------------------------------------------------------
15// ShimFit — prompt composition as fitting machinist's shims into a gap of
16// fixed height (the context window). Every section (system / tools / memory
17// / retrieved docs / user message) is a real DOM row whose height maps to its
18// token count; stack order IS prompt order, reordered by drag or by a full
19// keyboard listbox pattern (Space lifts, arrows move, Space drops) with FLIP
20// transforms on every reorder. Remaining budget is a real empty clearance
21// region above the stack, never a percentage bar. Inserting a tray candidate
22// that would blow the budget elastically compresses the stack, springs the
23// candidate back to the tray, pulses the largest truncatable row's edge, and
24// opens a persistent "thin this one" remedy — no error string, a visible
25// non-fit plus a suggested fix. Pure DOM/CSS, no canvas.
26// ---------------------------------------------------------------------------
27
28export interface ShimSection {
29 id: string;
30 label: string;
31 tokens: number;
32 /** may be offered as the trim target when an insert overflows */
33 truncatable?: boolean;
34 /** floor tokens can't be trimmed below; defaults to 30% of initial tokens */
35 minTokens?: number;
36}
37
38export interface ShimFitProps {
39 /** total context-window budget, in tokens */
40 budget?: number;
41 /** initial stack, top-to-bottom = prompt order */
42 sections?: ShimSection[];
43 /** candidates waiting in the tray, not yet part of the prompt */
44 candidates?: ShimSection[];
45 /** px per token for row height (min 8px floor still applies) */
46 scale?: number;
47 className?: string;
48 "aria-label"?: string;
49}
50
51// Floor a row at 16px, not 8px: an 8px row cannot contain its own ~14px label,
52// so a thin row (e.g. a 120-token message) let its centered text bleed past the
53// row and — being the last row, flush at the frame's clipped bottom edge — get
54// severed by the frame's overflow-hidden. 16px holds the (hairline-sized) label
55// cleanly; the stack still fits with clearance to spare.
56const MIN_ROW_PX = 16;
57const HAIRLINE_PX = 18;
58const COMPRESS_MS = 120;
59const FLIP_MS = 320;
60const FLIP_EASE = "cubic-bezier(0.22,1,0.36,1)";
61const PULSE_MS = 620;
62const SUGGEST_DISMISS_MS = 9000;
63
64const DEFAULT_SECTIONS: ShimSection[] = [
65// … truncated

Files it writes

  • registry/core/context-prompt-shims/component.tsx

Facts

Registry
ns-ui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-02
Last confirmed
12 days ago

Go to the source

Docs on ns-ui design.helpmarq.com nikolas-sapa/ns-ui on GitHub Raw registry item This item as JSON

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