An in-place editor for changing a value where it reads
Click a value or press ↵ to edit · ↵ saves · esc puts it back
pnpm dlx shadcn@latest add https://notchset.dev/r/inline-edit.jsonChange a value where you read it.
Every shadcn style · one file
Import it and pass your content. The props that matter most are listed next.
"use client";
import * as React from "react";
import { InlineEdit, formatDateShort, readMoney } from "@/components/ui/notchset/inline-edit";
import { useLessMotion } from "@/lib/notchset/motion";
import { useSelfPlay } from "./self-play";
import { useToday } from "./today";
/*
* Four fields alone, each changed where it is: an Amount, Seats, a Close date and a Website. Type it the short way
* ("52k", "next fri"): the field says what it saves as; Enter laps the spinner and the tidy form lands with its tick.
* Over $250,000 is refused: it needs Maya's approval, and the old value rolls back. "Saves fail" under the stage is a
* switch: while it is on every save throws; Enter keeps your words to try again, leaving the field puts the old value back. On arrival the Amount is typed "52k"
* once and settles as $52,000.
*/
const WORDS = { approver: "Maya", site: "stripe.com" };
/* the close date starts a month and a day after the real today */
const CLOSE_IN = 31;
const CAP = 250000;
const usd = (n: number) => `$${n.toLocaleString("en-US")}`;
const BEATS = [0, 380, 700];
const TYPED = "52k";
export default function InlineEditDemo() {
const failOn = false;
const w = WORDS;
const less = useLessMotion();
const [amount, setAmount] = React.useState("$48,000");
const [seats, setSeats] = React.useState("40");
const day = useToday();
const today = React.useMemo(() => new Date(+day.slice(0, 4), +day.slice(5, 7) - 1, +day.slice(8, 10)), [day]);
const [closed, setClose] = React.useState<string | null>(null);
const close = closed ?? formatDateShort(new Date(today.getFullYear(), today.getMonth(), today.getDate() + CLOSE_IN), today);
const [site, setSite] = React.useState(w.site);
/* the chip is a switch: while it is on every save fails, by Enter or by leaving the field (the old value comes back) */
const failing = React.useRef(failOn);
React.useEffect(() => {
failing.current = failOn;
}, [failOn]);
const root = React.useRef<HTMLDivElement>(null);
const play = useSelfPlay(root, { beats: BEATS, off: less });
React.useEffect(() => {
if (play.mine || play.step < 0) return;
const el = root.current;
if (less) {
// eslint-disable-next-line react-hooks/set-state-in-effect -- less motion rests on the end at once
if (play.step === 0) setAmount(usd(52000));
return;
}
if (play.step === 0) return void el?.querySelector<HTMLButtonElement>('[data-slot="inline-edit"][aria-label^="Amount"]')?.click();
const input = el?.querySelector<HTMLInputElement>('input[aria-label="Amount"]');
if (!input) return;
if (play.step === 1) {
Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set?.call(input, TYPED);
input.dispatchEvent(new Event("input", { bubbles: true }));
return;
}
input.dispatchEvent(new KeyboardEvent("keydown", { key: "Enter", bubbles: true }));
}, [play.step, play.mine, less]);
const save = (check?: (v: string) => string | undefined) => async (v: string) => {
await new Promise((r) => setTimeout(r, 300));
if (failing.current) throw new Error("offline");
return check?.(v);
};
const rows: [string, React.ReactNode][] = [
["Amount", <InlineEdit key="a" label="Amount" format="money" inputMode="decimal" minBusy={700} value={amount} onValueCommit={async (v) => (await save((x) => ((readMoney(x) ?? 0) > CAP ? `Over ${usd(CAP)} needs ${w.approver}'s approval` : undefined))(v)) ?? setAmount(v)} />],
["Seats", <InlineEdit key="s" label="Seats" format="count" inputMode="numeric" minBusy={700} value={seats} onValueCommit={async (v) => (await save()(v)) ?? setSeats(v)} />],
["Close date", <InlineEdit key="c" label="Close date" format="date" today={today} minBusy={700} value={close} onValueCommit={async (v) => (await save()(v)) ?? setClose(v)} />],
["Website", <InlineEdit key="w" label="Website" inputMode="url" minBusy={700} value={site} onValueCommit={async (v) => (await save()(v)) ?? setSite(v)} />],
];
/* only a person's own touch hands it over */
const mine = (e: React.SyntheticEvent) => e.nativeEvent.isTrusted && play.handOver();
return (
<div className="flex min-h-[300px] w-full items-center justify-center px-4">
<div ref={root} onPointerDownCapture={mine} onKeyDownCapture={mine} className="w-[480px] max-w-full">
<dl className="m-0 border-y border-[var(--ns-line)]">
{rows.map(([label, field]) => (
<div key={label} className="grid grid-cols-[120px_minmax(0,1fr)] items-start gap-x-4 border-b border-[var(--ns-line)] py-2.5 last:border-b-0 max-sm:grid-cols-[92px_minmax(0,1fr)] max-sm:pb-8">
<dt className="flex h-8 translate-y-px items-center text-[13px] text-[var(--ns-ink-3)] pointer-coarse:h-11">{label}</dt>
<dd className="m-0 min-w-0 pe-8 max-sm:pe-0">{field}</dd>
</div>
))}
</dl>
</div>
</div>
);
}"use client";
import * as React from "react";
import { InlineEdit, formatDateShort, readMoney } from "@/components/ui/notchset/inline-edit";
import { useLessMotion } from "@/lib/notchset/motion";
import { useSelfPlay } from "./self-play";
import { useToday } from "./today";
/*
* Four fields alone, each changed where it is: an Amount, Seats, a Close date and a Website. Type it the short way
* ("52k", "next fri"): the field says what it saves as; Enter laps the spinner and the tidy form lands with its tick.
* Over $250,000 is refused: it needs Maya's approval, and the old value rolls back. "Saves fail" under the stage is a
* switch: while it is on every save throws; Enter keeps your words to try again, leaving the field puts the old value back. On arrival the Amount is typed "52k"
* once and settles as $52,000.
*/
const WORDS = { approver: "Maya", site: "stripe.com" };
/* the close date starts a month and a day after the real today */
const CLOSE_IN = 31;
const CAP = 250000;
const usd = (n: number) => `$${n.toLocaleString("en-US")}`;
const BEATS = [0, 380, 700];
const TYPED = "52k";
export default function InlineEditDemo() {
const failOn = false;
const w = WORDS;
const less = useLessMotion();
const [amount, setAmount] = React.useState("$48,000");
const [seats, setSeats] = React.useState("40");
const day = useToday();
const today = React.useMemo(() => new Date(+day.slice(0, 4), +day.slice(5, 7) - 1, +day.slice(8, 10)), [day]);
const [closed, setClose] = React.useState<string | null>(null);
const close = closed ?? formatDateShort(new Date(today.getFullYear(), today.getMonth(), today.getDate() + CLOSE_IN), today);
const [site, setSite] = React.useState(w.site);
/* the chip is a switch: while it is on every save fails, by Enter or by leaving the field (the old value comes back) */
const failing = React.useRef(failOn);
React.useEffect(() => {
failing.current = failOn;
}, [failOn]);
const root = React.useRef<HTMLDivElement>(null);
const play = useSelfPlay(root, { beats: BEATS, off: less });
React.useEffect(() => {
if (play.mine || play.step < 0) return;
const el = root.current;
if (less) {
// eslint-disable-next-line react-hooks/set-state-in-effect -- less motion rests on the end at once
if (play.step === 0) setAmount(usd(52000));
return;
}
if (play.step === 0) return void el?.querySelector<HTMLButtonElement>('[data-slot="inline-edit"][aria-label^="Amount"]')?.click();
const input = el?.querySelector<HTMLInputElement>('input[aria-label="Amount"]');
if (!input) return;
if (play.step === 1) {
Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set?.call(input, TYPED);
input.dispatchEvent(new Event("input", { bubbles: true }));
return;
}
input.dispatchEvent(new KeyboardEvent("keydown", { key: "Enter", bubbles: true }));
}, [play.step, play.mine, less]);
const save = (check?: (v: string) => string | undefined) => async (v: string) => {
await new Promise((r) => setTimeout(r, 300));
if (failing.current) throw new Error("offline");
return check?.(v);
};
const rows: [string, React.ReactNode][] = [
["Amount", <InlineEdit key="a" label="Amount" format="money" inputMode="decimal" minBusy={700} value={amount} onValueCommit={async (v) => (await save((x) => ((readMoney(x) ?? 0) > CAP ? `Over ${usd(CAP)} needs ${w.approver}'s approval` : undefined))(v)) ?? setAmount(v)} />],
["Seats", <InlineEdit key="s" label="Seats" format="count" inputMode="numeric" minBusy={700} value={seats} onValueCommit={async (v) => (await save()(v)) ?? setSeats(v)} />],
["Close date", <InlineEdit key="c" label="Close date" format="date" today={today} minBusy={700} value={close} onValueCommit={async (v) => (await save()(v)) ?? setClose(v)} />],
["Website", <InlineEdit key="w" label="Website" inputMode="url" minBusy={700} value={site} onValueCommit={async (v) => (await save()(v)) ?? setSite(v)} />],
];
/* only a person's own touch hands it over */
const mine = (e: React.SyntheticEvent) => e.nativeEvent.isTrusted && play.handOver();
return (
<div className="flex min-h-[300px] w-full items-center justify-center px-4">
<div ref={root} onPointerDownCapture={mine} onKeyDownCapture={mine} className="w-[480px] max-w-full">
<dl className="m-0 border-y border-[var(--ns-line)]">
{rows.map(([label, field]) => (
<div key={label} className="grid grid-cols-[120px_minmax(0,1fr)] items-start gap-x-4 border-b border-[var(--ns-line)] py-2.5 last:border-b-0 max-sm:grid-cols-[92px_minmax(0,1fr)] max-sm:pb-8">
<dt className="flex h-8 translate-y-px items-center text-[13px] text-[var(--ns-ink-3)] pointer-coarse:h-11">{label}</dt>
<dd className="m-0 min-w-0 pe-8 max-sm:pe-0">{field}</dd>
</div>
))}
</dl>
</div>
</div>
);
}"use client";
import * as React from "react";
/*
* A demo that plays itself until the first touch: the script lives in the demo, never in the piece, which only gets
* the props a person would give it. It moves 0.4 s after the piece is first seen, then takes each step on its beat;
* off screen or paused it waits. The first press, key or focus on the piece (bind `handOver` to it; a scroll over it never counts) makes it the
* visitor's for good and drops every queued step; with less motion (`off`) it never plays and rests in its first frame.
* A host can hand it over from outside the piece too (a settings panel beside it the visitor has used): under
* <HandedOver value>, it never plays, a remount included.
*
* const play = useSelfPlay(root, { beats: [2800, 2800], loop: true, off: less });
* <div ref={root} onPointerDownCapture={play.handOver} onKeyDownCapture={play.handOver} onFocusCapture={play.handOver}>
* play.step // the step it is at, -1 before its first
* play.control // "pause" while it plays, "play" once paused (a new take), "replay" once it is over or yours
*
* Each step presses the piece's own controls (pressIn), so the script shows exactly what a hand can do.
*
* A host that shows the piece once (<PlayOnce value={{ settle }}>) changes three things: the script starts when the
* piece is first half in view and never again on coming back, it never loops, and with less motion (or `settle`) it
* takes every step at once, so the piece rests on the END of its moment. `hold` is a reason not to play at all that is
* not motion (a mode with nothing to show): it holds in every host. Under <PlayOnce value={{ active: false }}> (a look
* that is mounted but not shown) it waits until it is shown.
*/
type SelfPlayOptions = {
/** how long each step waits after the one before it, in ms; the first step waits 0.4 s after the piece is seen */
beats: readonly number[];
/** starts over after the last step; without it the script plays once and rests */
loop?: boolean | undefined;
/** no self-play at all (less motion): the piece is the visitor's from the start */
off: boolean;
/** no self-play for a reason other than motion (a mode with nothing to show), in every host */
hold?: boolean | undefined;
};
/** How a host shows the piece: once on arrival (see useSelfPlay). */
type PlayOnceHost = {
/** rest on the end at once, without playing (less motion, or a reset) */
settle?: boolean | undefined;
/** false while the piece is mounted but not shown: it waits */
active?: boolean | undefined;
};
const START = 400;
/**
* Whether a demo plays itself at all. Off: every piece rests in its first frame and is
* the visitor's from the start; nothing presses its controls for them.
*/
const SELF_PLAY: boolean = false;
/** True where the visitor has already taken the piece from outside it: nothing under it plays itself. */
const HandedOver = React.createContext(false);
/** A host that shows the piece once: play once on arrival, rest on the end (null: play as the demo asks). */
const PlayOnce = React.createContext<PlayOnceHost | null>(null);
function useSelfPlay(root: React.RefObject<Element | null>, { beats, loop: looped = false, off: still, hold = false }: SelfPlayOptions) {
const once = React.useContext(PlayOnce);
const active = once?.active !== false;
/* shown once: less motion (or a settled host) takes every step at once and rests on the end */
const quick = once != null && (still || Boolean(once.settle));
const loop = once == null && looped;
/* the first touch hands it over for good */
const [mine, setMine] = React.useState(false);
const handOver = React.useCallback(() => setMine(true), []);
const handedOver = React.useContext(HandedOver);
const off = !SELF_PLAY || hold || (quick ? false : still) || mine || (handedOver && !quick);
const [seen, setSeen] = React.useState(false);
const [paused, setPaused] = React.useState(false);
const [taken, setTaken] = React.useState(0);
const n = Math.max(1, beats.length);
const done = !loop && taken >= n;
React.useEffect(() => {
const el = root.current;
if (!active) return;
/* without an observer (an old browser, a test) it counts as seen */
if (!el || typeof IntersectionObserver === "undefined" || quick) {
const t = window.setTimeout(() => setSeen(true));
return () => window.clearTimeout(t);
}
/* shown once: first half in view starts it, and leaving never stops or restarts it */
const io = once
? new IntersectionObserver((es) => {
if (es.some((e) => e.isIntersecting && e.intersectionRatio >= 0.5)) {
setSeen(true);
io.disconnect();
}
}, { threshold: 0.5 })
: new IntersectionObserver((es) => setSeen(es.some((e) => e.isIntersecting)));
io.observe(el);
return () => io.disconnect();
}, [root, active, once, quick]);
const playing = !off && seen && active && !paused && !done;
const delay = quick ? 0 : taken === 0 ? START : (beats[taken % n] ?? START);
React.useEffect(() => {
if (!playing) return;
const t = window.setTimeout(() => setTaken((k) => k + 1), delay);
return () => window.clearTimeout(t);
}, [playing, taken, delay]);
/* one control in one place: Pause while it plays, Play (a new take) once paused, Replay once it is over or yours */
/* self-play off: never "over", so a demo rests in its FIRST frame, not its end frame */
const control: "pause" | "play" | "replay" = paused || !SELF_PLAY ? "play" : off || done ? "replay" : "pause";
return { step: taken === 0 ? -1 : (taken - 1) % n, taken, playing, control, mine, handOver, pause: () => setPaused(true) };
}
/**
* Presses a real control inside `root`, as the visitor would: the first match of `selector`, or the one whose text is
* `text`. A click only, so it never counts as the visitor's touch.
*/
function pressIn(root: Element | null, selector: string, text?: string) {
const all = [...(root?.querySelectorAll<HTMLElement>(selector) ?? [])];
(text == null ? all[0] : all.find((el) => el.textContent?.trim() === text))?.click();
}
export { HandedOver, PlayOnce, pressIn, useSelfPlay, type PlayOnceHost, type SelfPlayOptions };"use client";
import * as React from "react";
/*
* The real today, for every demo that shows a date: a calendar always opens on the latest day. A demo's data is written around its own anchor day; `useDays(anchor)` moves
* every date by the distance from that anchor to the visitor's today, so "in 3 days" stays in 3 days and today is
* the real today.
*
* Hydration: the server and the hydrating pass render each demo at its own anchor (the text in the server's HTML);
* the client then reads its own clock and moves the dates, so nothing differs while hydrating.
*
* The one switch, ANCHOR mode or a pinned day, wins over the clock: `pinToday("anchor" | "YYYY-MM-DD" | null)` in
* code, or `window.__NS_TODAY__` set before the page runs (the visual gate sets "anchor", so its pictures hold:
* scripts/lib/ui-check-cache.mjs). Under vitest (NODE_ENV "test") it is "anchor": every demo reads its own dates.
*/
export const STABLE_TODAY = "2026-11-16";
export const DAY_MS = 86_400_000;
/** the switch's value that holds every demo at the day its data was written around */
export const ANCHOR = "anchor";
let pinned: string | null = null;
/** the switch: "anchor", a day ("YYYY-MM-DD"), or null to follow the clock again */
export function pinToday(day: string | null) {
pinned = day;
}
// read off globalThis: a Vite install has no Node types
const testing = () => (globalThis as { process?: { env?: { NODE_ENV?: string } } }).process?.env?.NODE_ENV === "test";
function frozen(): string | null {
const w = (globalThis as { __NS_TODAY__?: unknown }).__NS_TODAY__;
return pinned ?? (typeof w === "string" ? w : null) ?? (testing() ? ANCHOR : null);
}
const pad = (n: number) => String(n).padStart(2, "0");
/** the visitor's today in their own zone, as "YYYY-MM-DD" (or ANCHOR when the switch holds the demos still) */
export function readToday(): string {
const f = frozen();
if (f) return f;
const d = new Date();
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
}
/* a day key to its UTC midnight, and back */
export const dayMs = (day: string) => Date.UTC(+day.slice(0, 4), +day.slice(5, 7) - 1, +day.slice(8, 10));
export const dayKey = (ms: number) => new Date(ms).toISOString().slice(0, 10);
/** whole days from a to b */
export const daysBetween = (a: string, b: string) => Math.round((dayMs(b) - dayMs(a)) / DAY_MS);
/* a check once a minute catches midnight (none while the switch holds the day) */
const subscribe = (f: () => void) => {
if (frozen()) return () => {};
const t = setInterval(f, 60_000);
return () => clearInterval(t);
};
const serverToday = () => ANCHOR;
/* "YYYY-MM-DD", or ANCHOR on the server, while hydrating and under the switch */
const useClockDay = () => React.useSyncExternalStore(subscribe, readToday, serverToday);
/** today as "YYYY-MM-DD", for a demo with no dates of its own: `anchor` on the server, while hydrating and under
* the switch, then the visitor's own */
export function useToday(anchor = STABLE_TODAY): string {
const day = useClockDay();
return day === ANCHOR ? anchor : day;
}
export type Days = {
/** today, "YYYY-MM-DD" */
today: string;
/** today's UTC midnight */
todayMs: number;
/** days the anchor moved */
delta: number;
/** a "YYYY-MM-DD" (or a longer ISO stamp; its time is kept) written around the anchor, moved to the real today */
day: (iso: string) => string;
/** a moment written around the anchor (ms), moved by whole days */
ms: (at: number) => number;
};
export function shiftBy(today: string, anchor: string, weeks = false): Days {
const raw = daysBetween(anchor, today);
/* `weeks`: move by whole weeks so every date keeps its weekday (a week of meetings stays Monday to Friday): the
anchor's Monday-to-Sunday week lands on today's */
const delta = weeks ? Math.floor((raw + ((new Date(dayMs(anchor)).getUTCDay() + 6) % 7)) / 7) * 7 : raw;
return {
today,
todayMs: dayMs(today),
delta,
day: (iso) => (/^\d{4}-\d\d-\d\d/.test(iso) ? dayKey(dayMs(iso) + delta * DAY_MS) + iso.slice(10) : iso),
ms: (at) => at + delta * DAY_MS,
};
}
/** dates written around `anchor` (the demo's own today), moved so the anchor lands on the real today */
export function useDays(anchor: string, opts: { weeks?: boolean } = {}): Days {
const today = useToday(anchor);
const weeks = !!opts.weeks;
return React.useMemo(() => shiftBy(today, anchor, weeks), [today, anchor, weeks]);
}
/* the US public holidays of a year, as "YYYY-MM-DD" */
function holidaysOf(y: number): { day: string; name: string }[] {
const nth = (m: number, weekday: number, n: number) => {
const first = new Date(Date.UTC(y, m, 1)).getUTCDay();
return Date.UTC(y, m, 1 + ((weekday - first + 7) % 7) + (n - 1) * 7);
};
const last = (m: number, weekday: number) => {
const end = Date.UTC(y, m + 1, 0);
return end - ((new Date(end).getUTCDay() - weekday + 7) % 7) * DAY_MS;
};
return [
{ day: Date.UTC(y, 0, 1), name: "New Year's Day" },
{ day: nth(0, 1, 3), name: "Martin Luther King Jr. Day" },
{ day: nth(1, 1, 3), name: "Presidents' Day" },
{ day: last(4, 1), name: "Memorial Day" },
{ day: Date.UTC(y, 5, 19), name: "Juneteenth" },
{ day: Date.UTC(y, 6, 4), name: "Independence Day" },
{ day: nth(8, 1, 1), name: "Labor Day" },
{ day: nth(9, 1, 2), name: "Columbus Day" },
{ day: Date.UTC(y, 10, 11), name: "Veterans Day" },
{ day: nth(10, 4, 4), name: "Thanksgiving Day" },
{ day: Date.UTC(y, 11, 25), name: "Christmas Day" },
].map((h) => ({ day: dayKey(h.day), name: h.name }));
}
/** the US public holidays from one day to another, both kept */
export function usHolidays(from: string, to: string): { day: string; name: string }[] {
const out: { day: string; name: string }[] = [];
for (let y = +from.slice(0, 4); y <= +to.slice(0, 4); y++) out.push(...holidaysOf(y).filter((h) => h.day >= from && h.day <= to));
return out;
}
/** the report periods round a day: this quarter, last quarter, this year, the last 30 days */
export function periodsAround(today: string) {
const y = +today.slice(0, 4);
const q = Math.floor((+today.slice(5, 7) - 1) / 3);
const quarter = (y: number, q: number) => ({ start: `${y}-${pad(q * 3 + 1)}-01`, end: dayKey(Date.UTC(y, q * 3 + 3, 0)) });
const last = q === 0 ? quarter(y - 1, 3) : quarter(y, q - 1);
return [
{ label: "This quarter", ...quarter(y, q) },
{ label: "Last quarter", ...last },
{ label: "This year", start: `${y}-01-01`, end: `${y}-12-31` },
{ label: "Last 30 days", start: dayKey(dayMs(today) - 29 * DAY_MS), end: today },
];
}
/** a month's close dates: each "YYYY-MM-DD" keeps its day of the month in `month` ("YYYY-MM"), the last day at most */
export function inMonth(month: string, iso: string): string {
const last = new Date(Date.UTC(+month.slice(0, 4), +month.slice(5, 7), 0)).getUTCDate();
return `${month}-${pad(Math.min(+iso.slice(8, 10), last))}`;
}This example also uses Badge. This command installs them with it, so the example pastes as it is:
pnpm dlx shadcn@latest add https://notchset.dev/r/inline-edit.json https://notchset.dev/r/badge.jsoncomponents/ui/notchset/inline-edit.tsx
LevelAtom: uses no other piece.
Made ofNothing else from the library: the foundation alone.
Free, no account or key. One command for every shadcn style. With the @notchset registry added, @notchset/<name> works too.
Works with React 18.3 or 19 on Tailwind CSS v4, in any shadcn project. What's tested
The CLI adds the styles to the CSS file named in components.json (tailwind.css). Check that it points at your global stylesheet, that the project uses Tailwind CSS v4, and that the file is imported in your root layout. Installed by hand: paste styles.css into that file.
The sound you hear is this page's: the piece you install plays none, and calls onFeedback on each move so you can add your own.
value–
stringthe saved value (controlled: you set it after onCommit resolves); leave it out and pass defaultValue to let it keep its own
defaultValue""
stringthe starting value when it keeps its own: a save that onCommit accepts becomes the value
onValueCommit–
(next: string) => string | void | Promise<string | void>Save the new value (Enter or leaving the field). Return (or resolve) an error message to refuse it.
label–
stringWhat is being edited, for screen readers ("Amount").
display–
React.ReactNodeHow the value reads when not editing (formatting, an icon). Defaults to the value.
placeholder–
stringShown, quieter, when there is no value ("Add a due date").
inputMode–
React.HTMLAttributes<HTMLInputElement>["inputMode"]the keyboard a phone opens ("numeric", "email")
prefix–
stringone-line only: a mark drawn inside the open field before the text ("$"); it is not part of the value, and the field's name stays the label
variant"body"
"body" | "title" | "figure"body: a value in a row (the default); title: a record's heading; figure: the large number at the top of a record
rows1
numberlines shown while editing; more than 1 makes it multiline (Shift+Enter breaks a line)
labels–
InlineEditLabelsits words (INLINE_EDIT_LABELS): saved, failed, the button's name and the default placeholder
defaultEditingfalse
booleanopen as a field on arrival (uncontrolled); focus stays where it was until the field is used
name–
stringthe form field name: a form sends the saved value
format–
"text" | "money" | "count" | "date"what the value is: money and count read shorthand (52k, 1.2m, $52,000), date reads words (next fri, dec 12); the field says what it saves as while you type, and saves the tidy form. Plain text by default.
kind–
"text" | "money" | "count" | "date"Deprecated: use `format` (kept for one release)
minBusy0
numberthe shortest a save shows busy, in ms, so a quick answer still reads as saved (0 by default)
currencyDEFAULT_CURRENCY
stringmoney: the currency (USD by default); date: the day "today" means (now by default)
today–
Datelocale"en-US"
stringhow money and dates are written (en-US by default)
onFeedback–
(e: FeedbackEvent) => voidcalled once per move, for your sound or haptics
Three usesan invoice amount · a due date · a document's title
Give your coding assistant the Markdown guide instead of screenshots.
https://notchset.dev/api/mcp (setup)v2.0.0 · 2026-11-17breaking
No longer ships button-look.ts (ButtonBin, ButtonBusy, ButtonPlane, ButtonPuff, ButtonRoll, ButtonSparks, ButtonTick, EdgeBurst, QUIET_PILL, buttonBase, buttonIntents, buttonResults, buttonRollLayer, buttonSizes, buttonSquare, play, ButtonRollState, useButtonRoll), which it stopped using; a copy that imported them through this item imports them from button-class.ts and button-move.ts.ts. No longer ships hit-area.ts (HIT_AREA), which it stopped using; a copy that imported them through this item imports them from that file. Ships button-move.ts (ButtonRoll, buttonRollLayer, play, ButtonRollState, useButtonRoll), which it now uses. Ships field-parts.tsx (clearOfKeyboard, fieldSurface, useFocusRefused), which it now uses. Ships read-money.ts (readMoney), which it now uses. Internal files split; installs smaller; no change to the piece's own API. Renamed: . recheck: copies that import button-look.ts, hit-area.ts through inline-edit
v1.2.0 · 2026-11-17
New props: format.
v1.1.0 · 2026-11-17
New props: currency, kind, locale, minBusy, onFeedback, today. Ships button-look.ts (ButtonBin, ButtonBusy, ButtonPlane, ButtonPuff, ButtonRoll, ButtonSparks, ButtonTick, EdgeBurst, QUIET_PILL, buttonBase, buttonIntents, buttonResults, buttonRollLayer, buttonSizes, buttonSquare, play, ButtonRollState, useButtonRoll), which it now uses. Ships feedback.ts (FeedbackEvent, FeedbackProps), which it now uses. Ships hit-area.ts (HIT_AREA), which it now uses. inline-edit.tsx now exports formatDateShort, readDate, readMoney.
v1.0.0 · 2026-11-09
Released free with the Notchset system.