- Accordion
- Action Bar
- Alert Dialog
- Alert
- Announcement
- Aspect Ratio
- Autocomplete
- Avatar
- Badge
- Bottom Navigation
- Breadcrumb
- Button Group
- Button
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Circular Progress
- Circular Slider
- Clipboard
- Collapsible
- Color Picker
- Combobox
- Command
- Context Menu
- Data List
- Date Picker
- Dialog
- Drawer
- Editable
- Field
- File Upload
- Float
- Floating Panel
- Frame
- Hint
- Hover Card
- Image Cropper
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Link Overlay
- Listbox
- Marquee
- Menu
- Native Select
- Number Input
- Pagination
- Popover
- Progress
- Prose
- QR Code
- Radio Group
- Rating
- Resizable
- Scroll Area
- Segment Group
- Select
- Separator
- Sheet
- Sidebar
- Signature Pad
- Skeleton
- Skip Nav
- Slider
- Spinner
- Status
- Steps
- Switch
- Table
- Tabs
- Textarea
- Timer
- Toast
- Toggle Group
- Toggle Tooltip
- Toggle
- Tooltip
- Tour
- Tree View
Installation
pnpm dlx shadcn@latest add https://shark.vini.one/r/editable.json
Usage
import { Editable, EditableArea, EditableInput, EditablePreview, EditableControl, EditableCancelTrigger, EditableSubmitTrigger, EditableEditTrigger, } from "@/components/ui/editable";
<Editable> <EditableArea> <EditableInput /> <EditablePreview /> </EditableArea> <EditableControl> <EditableCancelTrigger/> <EditableSubmitTrigger/> <EditableEditTrigger/> </EditableControl> </Editable>
Controlled
Make the entire form editable at once by using the edit prop.
The value and onValueChange props control the editable component programmatically.
Modes
The activationMode prop controls how editing is triggered.
Focus
Editing starts when the field receives focus.
Click
Editing starts with a single click on the preview.
Double-Click
Editing starts with a double-click on the preview.
None
No automatic activation. Use EditableEditTrigger to manually start editing.
Sizes
The size prop on EditablePreview controls the preview dimensions.
Small
Large
Orientation
The orientation prop controls the layout of the editable component and its controls.
Horizontal
Vertical
Examples
With Textarea
Without Controls
Edit without control buttons. Press Enter to save, Escape to cancel.
API Reference
Editable
Root component. Manages edit mode and value.
| Prop | Type | Default |
|---|---|---|
activationMode | focus | dblclick | click | none | 'focus' |
orientation | "horizontal" | "vertical" | "horizontal" |
submitMode | both | enter | blur | none | 'both' |
asChild | boolean | - |
className | string | - |
EditableArea
Wraps the input and preview views.
| Prop | Type | Default |
|---|---|---|
asChild | boolean | - |
className | string | - |
EditableInput
Input shown when editing. Use asChild for custom input elements.
| Prop | Type | Default |
|---|---|---|
asChild | boolean | - |
className | string | - |
EditablePreview
Shows the value when not editing. Click to enter edit mode.
| Prop | Type | Default |
|---|---|---|
asChild | boolean | - |
size | "xs" | "sm" | "md" | "lg" | "xl" | "md" |
className | string | - |
EditableControl
Holds edit/cancel/submit control buttons.
| Prop | Type | Default |
|---|---|---|
asChild | boolean | - |
className | string | - |
EditableEditTrigger
Enters edit mode on click.
| Prop | Type | Default |
|---|---|---|
asChild | boolean | - |
className | string | - |
EditableCancelTrigger
Cancels editing and reverts to previous value.
| Prop | Type | Default |
|---|---|---|
asChild | boolean | - |
className | string | - |
EditableSubmitTrigger
Submits the edited value and exits edit mode.
| Prop | Type | Default |
|---|---|---|
asChild | boolean | - |
className | string | - |
For a complete list of props, see the Ark UI documentation.