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/delete-row

Delete Row

shadcn-htmx/delete-row
FreeComponent

A row/item delete affordance that confirms, sends DELETE, then fades out in place. One inherited declaration on the list host (hx-confirm:inherited / hx-target:inherited / hx-swap:inherited) covers every row, so each Delete button only needs hx-delete — no per-row wiring and no client-side list state. The server replies 200 with an empty body and the row simply disappears after a CSS opacity fade. Zero custom JS.

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/delete-row.json

Source

registry/ui/delete-row.tsxshadcn-htmx.productdevbook.com/r/delete-row.json · first 6 KB
1/** @jsxImportSource hono/jsx */
2import type { PropsWithChildren } from "hono/jsx"
3import { cn, type ClassValue } from "@/registry/lib/cn"
4import { buttonClasses, type ButtonVariant, type ButtonSize } from "@/registry/ui/button"
5
6// Delete Row — shadcn-htmx, htmx v4 + Tailwind v4.
7//
8// A row/item delete affordance that confirms, sends DELETE, then fades out
9// in place. One inherited declaration on the list host covers every row —
10// no per-row wiring, no client-side list state. The server answers the
11// DELETE with a 200 and an empty body, so the row is swapped with nothing
12// and simply disappears.
13//
14// Built on:
15// repos/htmx/www/src/content/patterns/03-records/02-delete-in-place.md
16// The canonical pattern: the <tbody> hoists hx-confirm / hx-target /
17// hx-swap with the :inherited modifier; each Delete button only needs
18// hx-delete. During the swap delay htmx adds the htmx-swapping class to
19// the target row, which we use to drive a CSS opacity fade.
20// repos/htmx/www/src/content/docs/03-features/08-attribute-inheritance.md:10,29-32
21// htmx v4 inheritance is explicit — hoist an attribute to an ancestor
22// with the `:inherited` modifier (e.g. hx-confirm:inherited).
23// repos/htmx/www/src/content/reference/01-attributes/05-hx-delete.md:25-29
24// Respond to DELETE with a 200 + empty body to remove the element (a
25// 204 performs no swap).
26// repos/htmx/www/src/content/reference/01-attributes/08-hx-target.md
27// hx-target="closest tr" targets the row containing the button.
28// repos/htmx/www/src/content/reference/01-attributes/07-hx-swap.md:211
29// hx-swap="outerHTML swap:Nms" delays the removal by N ms, giving the
30// fade transition time to play before the node is detached.
31// repos/htmx/www/src/content/reference/01-attributes/22-hx-confirm.md
32// hx-confirm prompts with window.confirm before issuing the request.
33// repos/htmx/src/htmx.js:1304,1394
34// htmx adds `htmx-swapping` to the target before the swap delay and
35// removes it after the swap — the hook our fade keys off.
36//
37// Native semantics:
38// - The list host is a real <tbody> (default) so the rows live in a valid
39// table model and AT users get row/column navigation for free.
40// repos/mdn/files/en-us/web/html/reference/elements/tbody/index.md
41// - The delete affordance is a real <button>, so Enter / Space activation
42// and focus come from the platform; no role/tabindex needed.
43// … 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