BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/jarvis-ui/copyable-field

Copyable Field

jarvis-ui/copyable-field
FreeComponent

A selectable, horizontally scrollable field with a copy action.

Live preview

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

Install it

npx shadcn@latest add https://ui.jarv.is/r/copyable-field.json

Source

ui/copyable-field.tsxui.jarv.is/r/copyable-field.json
1"use client";
2
3import * as React from "react";
4
5import { CopyButton } from "@/components/ui/copy-button";
6import { Field, FieldLabel } from "@/components/ui/field";
7import { InputGroup, InputGroupAddon } from "@/components/ui/input-group";
8import { ScrollArea } from "@/components/ui/scroll-area";
9import { cn } from "@/lib/utils";
10
11type CopyableFieldCopyEvent = Parameters<
12 NonNullable<React.ComponentProps<typeof CopyButton>["onCopied"]>
13>[1];
14
15type CopyableFieldProps = Omit<React.ComponentProps<typeof Field>, "children" | "onCopy"> & {
16 label: React.ReactNode;
17 value: string;
18 copyValue?: string;
19 showLabel?: boolean;
20 copyLabel?: string;
21 copiedLabel?: string;
22 resetDelay?: number;
23 children?: React.ReactNode;
24 onCopy?: (value: string, event: CopyableFieldCopyEvent) => void;
25 onCopyError?: (error: unknown, event: CopyableFieldCopyEvent) => void;
26};
27
28function CopyableField({
29 label,
30 value,
31 copyValue = value,
32 showLabel = true,
33 copyLabel = "Copy to clipboard",
34 copiedLabel = "Copied",
35 resetDelay = 2000,
36 children,
37 className,
38 onCopy,
39 onCopyError,
40 ...props
41}: CopyableFieldProps) {
42 const contentRef = React.useRef<HTMLSpanElement>(null);
43
44 const handleSelect = React.useCallback(() => {
45 if (!contentRef.current) {
46 return;
47 }
48
49 const selection = window.getSelection();
50
51 if (!selection) {
52 return;
53 }
54
55 const range = document.createRange();
56
57 range.selectNodeContents(contentRef.current);
58 selection.removeAllRanges();
59 selection.addRange(range);
60 }, []);
61
62 return (
63 <Field className={cn("min-w-0", className)} {...props}>
64 <FieldLabel className={cn(showLabel ? "text-xs text-muted-foreground uppercase" : "sr-only")}>
65 {label}
66 </FieldLabel>
67 <InputGroup className="h-10 min-w-0">
68 <ScrollArea className="h-full min-w-0 flex-1 [&_[data-slot=scroll-area-scrollbar]]:hidden">
69 <button
70 type="button"
71 aria-label={typeof label === "string" ? `Select ${label}` : "Select text"}
72 onClick={handleSelect}
73 className="h-full w-full min-w-0 cursor-text bg-transparent py-0 pr-2 pl-3 text-left font-mono text-[13px] outline-none"
74 >
75 <span ref={contentRef} className="inline-block whitespace-nowrap">
76 {children ?? value}
77 </span>
78 </button>
79 </ScrollArea>
80 <InputGroupAddon align="inline-end">
81 <CopyButton
82 value={copyValue}
83// … truncated

What it pulls in

Other registry items

  • field
  • input-group
  • https://ui.jarv.is/r/copy-button.json
  • https://ui.jarv.is/r/scroll-area.json

Files it writes

  • ui/copyable-field.tsx

Facts

Registry
jarvis-ui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-09
Last confirmed
today

Go to the source

Docs on jarvis-ui ui.jarv.is jakejarvis/ui on GitHub Raw registry item This item as JSON

More from jarvis-ui

All 10 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Browser Windowbrowser-windowjarvis-uiComponentsFreeno deps
Cookie Consentcookie-consentjarvis-uiComponentsFreeno deps
Copy Buttoncopy-buttonjarvis-uiComponentsFree1 dep
Parallax Cardparallax-cardjarvis-uiComponentsFree1 dep
Scroll Areascroll-areajarvis-uiComponentsFree1 dep
Stepperstepperjarvis-uiComponentsFree1 dep
Tipovertipoverjarvis-uiComponentsFree1 dep · 2 files
Toasttoastjarvis-uiComponentsFree2 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