{"name":"flip-text","entry":"component","title":"FlipText","description":"Letters tumble on hover with a vermilion accent. Click, tap, or use the keyboard to flip the whole phrase. Respects reduced motion.","category":"Interactive","capabilities":["controls"],"needsRemotion":false,"registryDependencies":["@jbm/tokens"],"install":"npx shadcn@latest add @jbm/flip-text","installName":"flip-text","page":"https://jbm-ui.bns.studio/c/flip-text","registryItem":"https://jbm-ui.bns.studio/r/flip-text.json","sourcePath":"registry/jbm/ui/flip-text.tsx","files":[{"source":"registry/jbm/ui/flip-text.tsx","target":"src/jbm/ui/flip-text.tsx","import":"@/jbm/ui/flip-text","type":"registry:ui"}],"endpoints":{"markdown":"https://jbm-ui.bns.studio/catalog/flip-text.md","json":"https://jbm-ui.bns.studio/catalog/flip-text.json"},"snippet":"import { FlipText } from \"@/jbm/ui/flip-text\"\n\n<FlipText duration={450} style={{ fontSize: 48 }}>Una idea viva.</FlipText>\n// Hover individual letters. Click, tap, Enter, or Space flips all.\n// A button: do not nest inside another button or link.","api":[{"export":"FlipText","kind":"component","summary":"A native button whose graphemes each flip 360° on the X axis (lifting 0.15em and passing through the accent color at the midpoint) using the Web Animations API. Mouse hover flips one character; click, tap, Enter, or Space flips every character in sequence, staggered 25ms apart. The accessible name is `Flip text: <children>`. No animation runs under reduced motion.","props":[{"name":"children","type":"string","required":true,"default":null,"description":"The phrase, as a plain string. Split into words and graphemes; whitespace is preserved."},{"name":"duration","type":"number","required":false,"default":"450","description":"Milliseconds for each character's flip. Negative values clamp to 0; non-finite values fall back to 450."},{"name":"accentColor","type":"string","required":false,"default":"color.accent","description":"Color each character passes through at the middle of its flip."},{"name":"reducedMotion","type":"boolean","required":false,"default":null,"description":"Overrides the system prefers-reduced-motion setting. When reduced, flips are skipped and any running flips are cancelled."},{"name":"className","type":"string","required":false,"default":null,"description":"Class name on the button."},{"name":"style","type":"CSSProperties","required":false,"default":null,"description":"Inline styles merged over the defaults (Geist sans, weight 800, line-height 1.3, ink, transparent background); set fontSize here."}],"passthrough":[]}],"stage":{"mode":"fluid","reason":"An inline-block button sized by its text: height is lines × fontSize × 1.3 plus 0.2em top and bottom padding, width follows the text up to 100% of the container, where it wraps."},"examples":[{"title":"Flip a headline","code":"import { FlipText } from \"@/jbm/ui/flip-text\"\n\n<FlipText duration={450} style={{ fontSize: 48 }}>Una idea viva.</FlipText>\n// Hover individual letters. Click, tap, Enter, or Space flips all.\n// A button: do not nest inside another button or link."}],"qa":["Hover single letters with a mouse: each tumbles once and returns to ink; re-hovering mid-flip restarts that letter cleanly.","Click, tap, and press Enter or Space with keyboard focus: every letter flips in a left-to-right stagger, then all characters return to ink.","Check touch: tapping flips the whole phrase; pointer-enter from touch does not flip single letters.","Enable prefers-reduced-motion, or pass reducedMotion: no letter moves, and flips in progress are cancelled when the preference turns on.","Check the focus ring is visible and the phrase wraps between words on a narrow screen."],"related":[{"name":"tokens","relation":"installs"}],"setup":{"namespace":"@jbm","componentsJson":{"registries":{"@jbm":"https://jbm-ui.bns.studio/r/{name}.json"}},"command":"npx shadcn@latest add @jbm/<name>","target":"src/jbm/","importAlias":"@/jbm/…","tsconfigPaths":{"@/*":["./src/*"]}},"rules":["Install through the @jbm namespace: each registry item JSON (/r/<name>.json) carries its files' contents and each guide is served at /docs/<slug>.md, so agents never need the source repository (it is public on GitHub for people browsing the code).","Files install to src/jbm/ and import as @/jbm/…, which needs the @/* → ./src/* path alias in tsconfig.json.","Items marked needsRemotion require the remotion package and must render inside a Remotion composition or Player; every other item works in any React page.","Use one vermilion accent per composition; accent2 is for annotations only and soft is for dark surfaces only.","Stages are 1920×1080 landscape and 1080×1920 vertical with declared safe areas; each item's stage field declares its size in stage pixels, and scenes compose from YAML-shaped specs with @jbm/scene-spec."],"links":{"catalog":"https://jbm-ui.bns.studio/catalog.json","llms":"https://jbm-ui.bns.studio/llms.txt"}}