photocn

Search

Search the docs

0

Blur

Lens blur (bokeh or gaussian). Drag the dot on the photo to choose what stays sharp.

"use client";

import { ImageEditorProvider } from "photocn/react";

import { ImageEditorCanvas } from "@/components/image-editor/canvas";
import { ImageEditorBlur } from "@/components/image-editor/blur-panel";

export default function BlurDemo() {
  return (
    <ImageEditorProvider src="/samples/dog.jpg" defaultTool="blur">
      <div className="grid h-[520px] grid-rows-[1fr_auto] overflow-hidden rounded-xl border bg-background sm:grid-cols-[1fr_300px] sm:grid-rows-1">
        <ImageEditorCanvas className="min-h-0 p-2" />
        <aside className="max-h-60 overflow-y-auto border-t sm:max-h-none sm:border-t-0 sm:border-l">
          <ImageEditorBlur />
        </aside>
      </div>
    </ImageEditorProvider>
  );
}

Installation

pnpm dlx shadcn@latest add @photocn/image-editor-blur

Usage

import { ImageEditorBlur } from "@/components/image-editor/blur-panel";

<ImageEditorBlur />

Props

PropTypeDescription
activeKind"bokeh" | "gaussian"The blur type shown.
disabledbooleanTurn off the panel.