Ask AI

A popover prompt launcher with an animated mascot trigger, one-click query links for major AI providers, and instant clipboard fallback.

Installation

Ask AI is published as a shadcn registry item. The CLI drops the file into your project, installs its dependencies, and adds any primitives it relies on.

$npx shadcn@latest add https://akoder.xyz/r/ask-ai.json

Or register the @akoder namespace once in components.json to install by name:

"registries": { "@akoder": "https://akoder.xyz/r/{name}.json" }

Usage

import { AskAI } from "@/components/ui/ask-ai";
 
export function Hero() {
  return (
    <AskAI
      prompt="Hi! I'm on Aditya Ojha's portfolio (https://akoder.xyz). Based on this page, introduce him: what he builds, his stack, and what he is looking for."
      title="ask an ai about me"
      description="a fresh perspective, from your favorite assistant."
      label="ask an ai"
    />
  );
}
 
// Minimal floating blob trigger with tooltip
export function FloatingAI() {
  return (
    <AskAI
      blobOnly
      size="default"
      side="top"
      align="end"
      tooltip="ask an ai"
      prompt="Hi! I'm on Aditya Ojha's portfolio (https://akoder.xyz). Based on this page, introduce him: what he builds, his stack, and what he is looking for."
    />
  );
}

Props

PropTypeDefaultNotes
promptstringrequiredThe query or prompt passed to the selected AI provider or copied to clipboard.
titlestring"Ask an AI about me"Heading text rendered at the top of the popover card.
descriptionstring"A fresh perspective, from your favorite assistant."Subtitle description rendered below the popover title.
labelstring"Ask an AI"Button label displayed inside the trigger next to the mascot.
tooltipstring-Tooltip text displayed when hovering the trigger. Defaults to label or "ask an ai" when blobOnly is enabled.
blobOnlybooleanfalseWhen true, renders only the animated mascot inside a circular trigger without the label text.
providersreadonly AIProvider[]defaultAIProvidersArray of AI provider definitions with brand colors, URL patterns, and query params.
size"default" | "compact""default"Sizing preset for the trigger pill and mascot. Compact uses tighter padding and a smaller blob mascot.
side"top" | "bottom" | "left" | "right""top"Placement side for the popover relative to the trigger. The mascot gaze automatically turns toward this side when awake.
align"start" | "center" | "end""start"Alignment of the popover content along the trigger edge.
openboolean-Controlled open state for the popover.
onOpenChange(open: boolean) => void-Callback fired when the open state changes.
defaultOpenbooleanfalseInitial open state when uncontrolled.
classNamestring-Extra class names forwarded to the trigger button.

Notes & Features

Manual installation

Copy components/ui/ask-ai.tsx and components/ui/popover.tsx into your project, then install the required dependencies:

npm i radix-ui lucide-react

Ensure your project includes the standard shadcn tooltip primitive (or copy components/ui/tooltip.tsx).

examples

Explore different presets, palettes, and configurations.

Portfolio introduction

Full-sized launcher with a prompt asking the AI to introduce your background, stack, and notable work.

Example 1 of 3: Portfolio introduction