AI Companion Toggle

The lower-right Artisan companion launcher featuring gradually blinking, cursor-glancing eyes that spring-expand ChatGPT, Claude, and Perplexity actions into a 2x2 corner arc (plus a Sparkles popover variant).

Corner Stage (artisan)Click companion below right

Interactive Controls

variant
defaultOpen

Installation

npm install framer-motion lucide-react react-icons

Props API

PropTypeDefaultDescription
variant"artisan" | "standard""artisan"Switches between the Artisan blinking-eyes 2x2 radial cluster and the Sparkles popover.
containedbooleanfalsePositions inline inside a relative corner stage instead of fixed viewport coordinates.
promptstring"Analyze this developer portfolio..."Pre-filled prompt copied to clipboard and passed to ChatGPT, Claude, and Perplexity.
defaultOpenbooleanfalseInitial expanded state of the launcher.
  • Closes automatically on Escape key press or outside pointer click.
  • Copies the analysis prompt to clipboard cleanly when a target AI provider is chosen.
  • Uses GPU transform springs for the 2x2 radial fan-out.

Source Files

"use client";

import React, { useEffect, useRef, useState } from "react";
import { AnimatePresence, motion } from "framer-motion";
import { Check, Sparkles, X } from "lucide-react";
import { RiOpenaiFill } from "react-icons/ri";
import { SiClaude, SiPerplexity } from "react-icons/si";

export interface AICompanionWidgetProps {
  variant?: "artisan" | "standard";
  prompt?: string;
  contained?: boolean;
  defaultOpen?: boolean;
}

const SERVICES = [
  {
    name: "ChatGPT",
    buildUrl: (prompt: string) =>
      `https://chatgpt.com/?q=${encodeURIComponent(prompt)}`,
    bg: "bg-[#10a37f]",
    hoverBg:
      "hover:bg-[#10a37f] hover:border-[#10a37f] hover:text-white dark:hover:bg-[#10a37f] dark:hover:border-[#10a37f] dark:hover:text-white",
    offset: { x: -56, y: -56 },
“Good design is as little design as possible.”
Dieter Rams