Staaarter

AI Prompt Playground Hero

A two-column hero: marketing copy, a heading, description, and benefit checklist on the left, and an interactive mini prompt playground on the right. Clicking an example chip shows its matching canned response, and typing a custom prompt and submitting shows a generic fallback response, giving visitors a hands-on preview before signing up.

By Staaarter Team
Chat
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/ai-prompt-playground-hero.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/chat/chat20.tsx instead.

Usage

The file also exports chat20Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Chat20, chat20Demo } from "@/components/blocks/chat/chat20";

export default function Page() {
  return <Chat20 {...chat20Demo} />;
}

Props

PropTypeDefaultDescription
headingstring"Try the playground before you sign up"Left-column heading.
descriptionstring"See how our AI responds to real prompts..."Left-column subheading.
benefitsstring[]noneBenefit bullets rendered with check icons on the left.
examplesPlaygroundExample[]noneExample prompt chips paired with their canned response text.
fallbackResponsestring"Here's a thoughtful, well-structured response..."Generic response shown when the visitor types and submits their own prompt.
classNamestringnoneExtra classes for the outer section element.

Types

export interface PlaygroundExample {
  id: string;
  prompt: string;
  response: string;
}

Behavior notes

  • Real client state: clicking an example chip sets the active response from a fixed prompt/response lookup array via useState.
  • Typing a custom prompt and submitting the form shows the generic fallbackResponse (also real useState), it does not call any actual AI model.
  • The response panel only renders once a response has been set (defaults to the first example's response on load), matching a realistic playground first-impression.
  • Full split-screen framing (grid lg:grid-cols-2 min-h-[700px]), same pattern as the Auth split-screen blocks.