UI.MD

Edit Popover

An inline editing popover for quick field updates without leaving the page.

Installation

$
npx shadcn@latest add https://ui.mattdowney.com/r/edit-popover.json

Usage

import { EditPopover } from "@/components/ui/edit-popover"

Examples

Default

Positioning

Control where the popover opens with side (top/right/bottom/left) and align (start/center/end); both pass through to the underlying PopoverContent. Pick a cell and the code below updates to match your selection.

Popover placement

side="bottom" align="start"

API Reference

PropTypeDefaultDescription
fields*Field[]-The editable fields. Each is a text field (key, label, placeholder) or a color field (key, label, colors).
values*Record<string, string>-Current field values, keyed by each field's key.
onSave*(values) => Promise<void>-Called with the edited values on save. The popover closes when it resolves.
trigger*React.ReactNode-The element that opens the popover. Rendered via the render prop, which merges Base UI's props onto it.
side"top" | "right" | "bottom" | "left""bottom"Preferred edge of the trigger to open against.
align"start" | "center" | "end""end"Alignment against the trigger along the chosen side.
avoidCollisionsbooleantrueWhen true, flips/shifts to stay in view. Set false to always honor side.
classNamestring-Extra classes for the popover content.