All components
Sketch Provider
The foundation every Sketchcn component draws through.
Provider documentationEvery hook, prop and CSS variable, with live examples.
Read the docs
Seeds
seed 1
seed 42
seed 1234
useSketchOutline
Default
Dashed
Rougher
Underline
useSketchBg
Hachure
Cross hatch
Zigzag
Installation
Add Sketch Provider with the shadcn CLI.
npx shadcn@latest add https://sketchcn.chuwii.com/r/sketch-provider.json
Examples
Wiring the provider up and drawing your own elements with it.
Wrap your app once, at the root
import { SketchProvider } from "@/components/ui/sketch-provider";

export function App({ children }: { children: React.ReactNode }) {
  return <SketchProvider>{children}</SketchProvider>;
}
Draw any element with useSketchOutline
import { useSketchOutline } from "@/components/ui/sketch-provider";

export function Panel({ children }: { children: React.ReactNode }) {
  const sketchOutline = useSketchOutline();

  return (
    <div className="relative isolate rounded-lg px-4 py-3">
      {children}
      <svg
        aria-hidden="true"
        data-sketch-outline
        className="-z-10"
        ref={sketchOutline.ref}
        style={sketchOutline.style}
      />
    </div>
  );
}