BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shadcn-htmx/highlight

Highlight

shadcn-htmx/highlight
FreeComponent

Semantic marker that wraps the words matching a search query in a native <mark>, the HTML element for text relevant to the user's current activity. Rendered entirely on the server, styled with theme tokens, zero client JS — drop it inside the fragment htmx swaps into a results list.

Live preview

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

Install it

npx shadcn@latest add https://shadcn-htmx.productdevbook.com/r/highlight.json

Source

registry/ui/highlight.tsxshadcn-htmx.productdevbook.com/r/highlight.json · first 6 KB
1/** @jsxImportSource hono/jsx */
2import type { Child } from "hono/jsx"
3import { cn, type ClassValue } from "@/registry/lib/cn"
4
5// Highlight — shadcn-htmx, htmx v4 + Tailwind v4.
6//
7// Semantic marker for text that is relevant to the user's current activity —
8// the canonical case is the words that matched a search query. It is a thin,
9// server-rendered wrapper around the native <mark> element; the server splits
10// a string on the query terms and wraps each match in a styled <mark>.
11//
12// Source of truth:
13// - <mark> semantics + the "search results" use case + the screen-reader
14// announcement note:
15// repos/mdn/files/en-us/web/html/reference/elements/mark/index.md
16// ("`<mark>` indicates a portion of the document's content which is likely
17// to be relevant to the user's current activity … the words that matched
18// a search operation." MDN also notes that `<mark>` is NOT announced by
19// default — which is correct here: a highlighted search match is a visual
20// affordance, not extra content to read out. Do not abuse the
21// ::before/::after announcement trick on a results list.)
22// - Don't use <mark> for syntax highlighting — use <span> (MDN, same file).
23// This component is strictly for relevance, never decoration.
24//
25// htmx: nothing of its own. The component just produces the marked-up HTML;
26// the server renders it inside whatever fragment htmx swaps in (e.g. the
27// <tr> rows returned to an Active Search `hx-target`). It forwards hx-*/data-*/
28// aria-* via {...rest} so a single highlighted term can also be a swap hook.
29// Verified there is no <mark>-specific htmx attribute:
30// repos/htmx/www/reference.md
31//
32// JS budget: none. Pure SSR + one CSS rule's worth of utility classes. The
33// native <mark> default is a yellow background; we reset it to theme tokens so
34// it reads on brand in light and dark and never clashes with selection colours.
35//
36// Accessibility:
37// - Keep highlighting to genuine matches. WCAG 1.4.1 (Use of Color): the
38// match must not rely on the tint alone to be perceivable — <mark> is a
39// real semantic element, and the bold weight + rounded chip give a
40// non-colour cue, so a match survives in a high-contrast / forced-colours
41// theme.
42// - Case-insensitive matching by default; the ORIGINAL casing of the source
43// text is preserved in the output (we slice the source, never the query).
44
45// … truncated

Facts

Registry
shadcn-htmx
Type
registry:ui
Access
Free
Files written
0
Licence
MIT
In the index
at or before 2026-08-13
Last confirmed
yesterday

Go to the source

Docs on shadcn-htmx shadcn-htmx.productdevbook.com productdevbook/shadcn-htmx on GitHub Raw registry item This item as JSON

More from shadcn-htmx

All 83 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordionaccordionshadcn-htmxComponentsFreeno deps
Active Searchactive-searchshadcn-htmxComponentsFreeno deps
Alertalertshadcn-htmxComponentsFreeno deps
Alert Dialogalert-dialogshadcn-htmxComponentsFreeno deps
Aspect Ratioaspect-ratioshadcn-htmxComponentsFreeno deps
Auto Gridauto-gridshadcn-htmxComponentsFreeno deps
Autocompleteautocompleteshadcn-htmxComponentsFreeno deps
Autosize Textareaautosize-textareashadcn-htmxComponentsFreeno 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