Powerful and customizable React image picker components built for modern applications and websites. These image pickers are built using React Aria and styled with Tailwind CSS.
or drag and drop
Installation
You can add this image picker component using our CLI or manually:
npx untitledui@latest add image-picker
Image picker examples
Below are examples and variations of this image picker component:
or drag and drop
API reference
Import the parts and assemble them:
import { ImagePicker } from "@/components/application/image-picker/image-picker"; <ImagePicker.Provider> <ImagePicker /> </ImagePicker.Provider> <ImagePicker.Provider> <ImagePicker.FillModeSelect /> <ImagePicker.AdjustmentSliders /> </ImagePicker.Provider>
ImagePicker
Renders a <div> element.
ImagePicker.AdjustmentSliders
Renders a <div> element.
ImagePicker.FillModeSelect
Renders Button.
ImagePicker.Provider
Import ImageProvider from @/components/application/image-picker/image-picker-context. Renders ImageColorPickerProvider.
FAQs
Please refer to our frequently asked questions page for more.
There are 7 adjustment sliders: exposure, contrast, saturation, temperature, tint, highlights and shadows. Each ranges from -100 to 100 and starts at 0. Pass onAdjustmentsChange to ImagePicker.Provider to receive the full adjustments object whenever a slider moves.
The fill mode dropdown offers "fill" (the default), "fit", "crop" and "tile". "fit" shows the whole image on a black background, "tile" repeats it in a grid of square tiles, and "fill" and "crop" currently render the same way: the image is scaled to cover the square canvas and the overflow is cropped.
Users can click to upload or drag and drop a file onto the canvas; only image/* files are accepted. Use the onImageChange callback on ImagePicker.Provider to receive the selected File.
Yes. The rotate button next to the fill mode dropdown turns the image 90 degrees clockwise on each click, cycling through 0, 90, 180 and 270 degrees, and the canvas preview updates immediately.
Yes. ImagePicker.FillModeSelect and ImagePicker.AdjustmentSliders can be placed anywhere inside an ImagePicker.Provider, and the useImageColorPicker hook gives you the shared state and actions (including rotateImage and resetAdjustments). Every part, including ImagePicker itself, throws an error if it is rendered outside the provider.
The picker does not export a processed file. onImageChange gives you the original File and onAdjustmentsChange the slider values; fill mode and rotation are available through useImageColorPicker().state. To produce the final image, call applyImageFilters from image-picker-utils.ts with your own canvas and those values.