MD-03Media
Focal Point Picker
Set where a photo's subject is and see every crop follow it live. Hover a crop to see what it cuts.
no extra packages
PROAudio Player Card and more like it are in Kokonut UI Pro
Installation
Focal Point Picker is a free, open-source React component in the Kokonut UI Media collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/focal-point-picker.tsx, so the code is yours to change.
npx shadcn@latest add @kokonutui/focal-point-pickerUsage
import FocalPointPicker from "@/components/kokonutui/focal-point-picker";
export default function Example() {
return <FocalPointPicker />;
}Props
srcstringDefault built-inaltstringDefault "Peaks above a sea of clouds"imageRationumberDefault 3 / 2The image's natural width over height.
defaultValueFocalPointDefault { x: 0.68, y: 0.38 }cropsFocalCrop[]Default built-inThe crops your layouts use; each previews the point live.
onValueChange(point: FocalPoint) => voidclassNamestringExtra classes for the root element.
FocalPoint
xrequirednumber0 to 1 from the left.
yrequirednumber0 to 1 from the top.
FocalCrop
labelrequiredstringratiorequirednumberWidth over height.
Dependencies
| Needs | Version | Comes from |
|---|---|---|
cn from lib/utils.ts | shadcn init | |
| React | 19 | Your app |
| Tailwind CSS | 4 | Your app |
No provider, font or global CSS to set up: the file works as soon as it lands.

