BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/uselayouts/inline-edit

Inline Edit

uselayouts/inline-edit
FreeComponent

An input that switches between read and edit modes.

Live preview

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

Install it

npx shadcn@latest add https://uselayouts.com/r/inline-edit.json

Source

registry/default/example/inline-edit.tsxuselayouts.com/r/inline-edit.json
1"use client";
2
3import { AnimatePresence, motion } from "motion/react";
4import { useRef, useState } from "react";
5import { Edit01Icon, Tick02Icon } from "@hugeicons/core-free-icons";
6import { HugeiconsIcon } from "@hugeicons/react";
7import { Input } from "@/components/ui/input";
8import { cn } from "@/lib/cn";
9
10function SaveInput() {
11 const [isEditing, setIsEditing] = useState(false);
12 const [value, setValue] = useState("this.urvish");
13
14 const inputRef = useRef<HTMLInputElement>(null);
15
16 return (
17 <div className="w-full flex justify-center items-center text-xl">
18 <motion.div
19 layout
20 initial={{
21 boxShadow: "0px 0px 2px hsl(var(--foreground) / 0.1)",
22 }}
23 animate={{
24 boxShadow: isEditing
25 ? " none border border-foreground"
26 : "0px 0px 2px hsl(var(--foreground) / 0.1)",
27 }}
28 className={cn(
29 "flex items-center relative overflow-hidden border-2 bg-background",
30 isEditing &&
31 "outline-none ring-2 ring-ring ring-offset-2 ring-offset-background"
32 )}
33 style={{ borderRadius: 60 }}
34 >
35 <Input
36 ref={inputRef}
37 value={value}
38 onChange={(e) => setValue(e.target.value)}
39 readOnly={!isEditing}
40 className={cn(
41 "h-12 border-0 shadow-none focus-visible:ring-0 bg-transparent p-0 text-base w-full min-w-32 pl-4 pr-12",
42 isEditing ? "text-foreground" : "text-muted-foreground"
43 )}
44 placeholder="username"
45 />
46 <AnimatePresence initial={false}>
47 {!isEditing ? (
48 <motion.span
49 key="pen"
50 layout="position"
51 initial={{ x: 50 }}
52 animate={{ x: 0 }}
53 exit={{ x: 50 }}
54 transition={{ type: "spring", bounce: 0.1 }}
55 onClick={() => {
56 setIsEditing(true);
57
58 if (inputRef.current) inputRef.current.select();
59 }}
60 className="absolute right-1 flex items-center justify-center h-10 w-10 rounded-full bg-card/80 border border-[0.2px] hover:bg-card cursor-pointer text-muted-foreground"
61 >
62 <HugeiconsIcon icon={Edit01Icon} size={20} />
63 </motion.span>
64 ) : (
65 <motion.span
66 key="check"
67 layout="position"
68 initial={{ x: 50 }}
69 animate={{ x: 0 }}
70 exit={{ x: 50 }}
71// … truncated

What it pulls in

npm packages

  • motion
  • @hugeicons/core-free-icons
  • @hugeicons/react
  • clsx
  • tailwind-merge

Other registry items

  • input

Files it writes

  • registry/default/example/inline-edit.tsx

Facts

Registry
uselayouts
Type
registry:component
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
yesterday

Go to the source

Docs on uselayouts uselayouts.com iurvish/uselayouts on GitHub Raw registry item This item as JSON

More from uselayouts

All 26 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
3D Book3d-bookuselayoutsComponentsFree3 deps
Animated Collectionanimated-collectionuselayoutsComponentsFree5 deps
Bento Cardbento-carduselayoutsComponentsFree5 deps
Bottom Menubottom-menuuselayoutsComponentsFree6 deps
BucketbucketuselayoutsComponentsFree5 deps · 2 files
Day Pickerday-pickeruselayoutsComponentsFree5 deps
Delete Buttondelete-buttonuselayoutsComponentsFree5 deps
Discover Buttondiscover-buttonuselayoutsComponentsFree5 deps
BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex