BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/loomui/lens-text

Lens Text

loomui/lens-text
FreeComponent

Text held out of focus until the pointer passes over it like a magnifying glass.

Live preview

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

Install it

npx shadcn@latest add https://loomui.design/r/lens-text.json

Source

registry/loomui/lens-text.tsxloomui.design/r/lens-text.json · first 6 KB
1"use client"
2
3import * as React from "react"
4
5import { cn } from "@/lib/utils"
6
7export interface LensTextProps extends React.ComponentProps<"span"> {
8 /** Blur radius of the resting text, in pixels. */
9 blur?: number
10 /** Diameter of the lens in pixels. */
11 size?: number
12 /** How much of the lens fades out at its edge, from `0` to `1`. */
13 feather?: number
14 /** Scale applied to the text under the lens. `1` is a plain focus window. */
15 magnify?: number
16 /** Corner radius of the frosted panel. Any CSS length; `em` scales with the type. */
17 radius?: string
18 /**
19 * Milliseconds the lens takes to catch up to the pointer, and the pace it
20 * opens and closes at. `0` locks it to the pointer.
21 */
22 follow?: number
23 /** Draw a hairline ring around the lens. */
24 ring?: boolean
25 /** Render the text sharp, with no blur and no lens. */
26 disabled?: boolean
27}
28
29/**
30 * A hovering pointer is the only way to aim the lens, so anything else (touch,
31 * pen, keyboard-only) gets the text sharp rather than never getting it at all.
32 */
33const HOVER_QUERY = "(hover: hover) and (pointer: fine)"
34const MOTION_QUERY = "(prefers-reduced-motion: reduce)"
35
36/** The lens opens slower than it tracks, or it pops on the way in. */
37const OPEN_FACTOR = 1.6
38
39/**
40 * Room for the blur to fall off inside the panel rather than at its edge.
41 * In `em` so it tracks the type it is wrapped around.
42 */
43const PANEL_PADDING = "0.28em 0.45em"
44
45function useMediaQuery(query: string, fallback: boolean) {
46 // Server and first client paint agree on `fallback`. The effect corrects it
47 // before anyone can interact, so there is no hydration mismatch.
48 const [matches, setMatches] = React.useState(fallback)
49
50 React.useEffect(() => {
51 const list = window.matchMedia(query)
52 const sync = () => setMatches(list.matches)
53
54 sync()
55 list.addEventListener("change", sync)
56 return () => list.removeEventListener("change", sync)
57 }, [query])
58
59 return matches
60}
61
62function clamp01(value: number) {
63 return Math.min(Math.max(value, 0), 1)
64}
65
66export function LensText({
67 children,
68 className,
69 blur = 8,
70 size = 110,
71 feather = 0.5,
72 magnify = 1,
73 radius = "0.35em",
74 follow = 130,
75 ring = false,
76 disabled = false,
77 style,
78 ...props
79}: LensTextProps) {
80 const ref = React.useRef<HTMLSpanElement>(null)
81 const frame = React.useRef(0)
82 const running = React.useRef(false)
83 const hasHover = useMediaQuery(HOVER_QUERY, true)
84 const reduceMotion = useMediaQuery(MOTION_QUERY, false)
85
86// … truncated

What it pulls in

Other registry items

  • utils

Files it writes

  • registry/loomui/lens-text.tsx

Facts

Registry
loomui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-20
Last confirmed
yesterday

Go to the source

Docs on loomui loomui.design rjcuff/Loom-UI on GitHub Raw registry item This item as JSON

More from loomui

All 91 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Aurora Backdropaurora-backdroploomuiComponentsFreeno deps
Bento Gridbento-gridloomuiComponentsFreeno deps
Card Stackcard-stackloomuiComponentsFreeno deps
Compare Slidercompare-sliderloomuiComponentsFreeno deps
Confetti Buttonconfetti-buttonloomuiComponentsFreeno deps
Count Upcount-uploomuiComponentsFreeno deps
Credit Cardcredit-cardloomuiComponentsFreeno deps
DrawerdrawerloomuiComponentsFree1 dep

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

KitGrade

SaaS starter kits, scored on what can be checked

kitgrade.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 KitGrade

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 KitGrade

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 KitGrade

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