Components / Content Generation
AI Image Prompt Builder
A guided image prompt builder with style presets, aspect ratio selector, and negative prompt support.
Components / Content Generation
A guided image prompt builder with style presets, aspect ratio selector, and negative prompt support.
Install the core libraries required for this component.
npm install react lucide-react"use client";
import React, { useState } from "react";
import { Image as ImageIcon, Sparkles, Layout, Palette, Move } from "lucide-react";
export default function AIImagePrompt() {
const [style, setStyle] = useState("Photorealistic");
const styles = ["Photorealistic", "Digital Art", "Oil Painting", "Cyberpunk", "Minimalist"];
return (
<div className="rounded-xl border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 p-6 shadow-sm w-full max-w-xl mx-auto overflow-hidden">
<div className="flex items-center gap-2 mb-8">
<ImageIcon className="h-4 w-4 text-emerald-500" />
<h3 className="text-sm font-bold text-zinc-900 dark:text-zinc-100">Image Prompt Engineer</h3>
</div>
<div className="space-y-8">
<div>
<label className="text-[10px] font-black uppercase tracking-widest text-zinc-500 mb-4 block">Visual Style</label>
<div className="flex flex-wrap gap-2">
{styles.map((s) => (
<button
key={s}
onClick={() => setStyle(s)}
className={`px-3 py-1.5 rounded-full text-[11px] font-bold border transition-all ${style === s
? "bg-emerald-600 border-emerald-600 text-white"
: "bg-white dark:bg-zinc-900 border-zinc-200 dark:border-zinc-800 text-zinc-500 hover:border-zinc-300"
}`}
>
{s}
</button>
))}
</div>
</div>
<div className="grid grid-cols-2 gap-4">
<div className="space-y-4">
<div className="flex items-center gap-2 text-zinc-500">
<Layout className="h-3.5 w-3.5" />
<span className="text-[10px] font-bold uppercase tracking-widest">Aspect Ratio</span>
</div>
<div className="flex gap-2">
{["1:1", "16:9", "9:16"].map(r => (
<button key={r} className="flex-1 py-1.5 rounded-lg border border-zinc-200 dark:border-zinc-800 text-xs font-bold text-zinc-600 dark:text-zinc-400 hover:bg-zinc-50 transition-colors">
{r}
</button>
))}
</div>
</div>
<div className="space-y-4">
<div className="flex items-center gap-2 text-zinc-500">
<Palette className="h-3.5 w-3.5" />
<span className="text-[10px] font-bold uppercase tracking-widest">Lighting</span>
</div>
<button className="w-full py-1.5 rounded-lg border border-zinc-200 dark:border-zinc-800 text-xs font-bold text-zinc-600 dark:text-zinc-400 flex items-center justify-center gap-2">
Cinematic Flare
<Move className="h-3 w-3" />
</button>
</div>
</div>
<div className="p-4 rounded-xl bg-zinc-900 text-zinc-300 font-mono text-xs leading-relaxed border border-zinc-800">
<span className="text-zinc-500 italic">// Generated Prompt</span><br />
A {style.toLowerCase()} portrait of a futuristic city with glowing lights, shot on 35mm lens, {style === "Photorealistic" ? "highly detailed, 8k resolution" : "stylized artistic textures"} --ar 16:9
</div>
</div>
</div>
);
} "use client";
import React, { useState } from "react";
import { Image as ImageIcon, Sparkles, Layout, Palette, Move } from "lucide-react";
export default function AIImagePrompt() {
const [style, setStyle] = useState("Photorealistic");
const styles = ["Photorealistic", "Digital Art", "Oil Painting", "Cyberpunk", "Minimalist"];
return (
<div className="rounded-xl border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 p-6 shadow-sm w-full max-w-xl mx-auto overflow-hidden">
<div className="flex items-center gap-2 mb-8">
<ImageIcon className="h-4 w-4 text-emerald-500" />
<h3 className="text-sm font-bold text-zinc-900 dark:text-zinc-100">Image Prompt Engineer</h3>
</div>
<div className="space-y-8">
<div>
<label className="text-[10px] font-black uppercase tracking-widest text-zinc-500 mb-4 block">Visual Style</label>
<div className="flex flex-wrap gap-2">
{styles.map((s) => (
<button
key={s}
onClick={() => setStyle(s)}
className={`px-3 py-1.5 rounded-full text-[11px] font-bold border transition-all ${style === s
? "bg-emerald-600 border-emerald-600 text-white"
: "bg-white dark:bg-zinc-900 border-zinc-200 dark:border-zinc-800 text-zinc-500 hover:border-zinc-300"
}`}
>
{s}
</button>
))}
</div>
</div>
<div className="grid grid-cols-2 gap-4">
<div className="space-y-4">
<div className="flex items-center gap-2 text-zinc-500">
<Layout className="h-3.5 w-3.5" />
<span className="text-[10px] font-bold uppercase tracking-widest">Aspect Ratio</span>
</div>
<div className="flex gap-2">
{["1:1", "16:9", "9:16"].map(r => (
<button key={r} className="flex-1 py-1.5 rounded-lg border border-zinc-200 dark:border-zinc-800 text-xs font-bold text-zinc-600 dark:text-zinc-400 hover:bg-zinc-50 transition-colors">
{r}
</button>
))}
</div>
</div>
<div className="space-y-4">
<div className="flex items-center gap-2 text-zinc-500">
<Palette className="h-3.5 w-3.5" />
<span className="text-[10px] font-bold uppercase tracking-widest">Lighting</span>
</div>
<button className="w-full py-1.5 rounded-lg border border-zinc-200 dark:border-zinc-800 text-xs font-bold text-zinc-600 dark:text-zinc-400 flex items-center justify-center gap-2">
Cinematic Flare
<Move className="h-3 w-3" />
</button>
</div>
</div>
<div className="p-4 rounded-xl bg-zinc-900 text-zinc-300 font-mono text-xs leading-relaxed border border-zinc-800">
<span className="text-zinc-500 italic">// Generated Prompt</span><br />
A {style.toLowerCase()} portrait of a futuristic city with glowing lights, shot on 35mm lens, {style === "Photorealistic" ? "highly detailed, 8k resolution" : "stylized artistic textures"} --ar 16:9
</div>
</div>
</div>
);
} Internal functions used to handle component logic.
| Function | Parameters |
|---|---|
| AIImagePrompt() | None |
React state variables managed within this component.
| Variable | Initial Value |
|---|---|
| style | "Photorealistic" |
All variable declarations found in this component.
| Name | Kind | Value |
|---|---|---|
| styles | | ["Photorealistic", "Digital Art", "Oil Painting", "Cyberpunk", "Minimalist"] |
Every JSX/HTML tag used in this component, with usage count and source.
| Tag | Count | Type | Source |
|---|---|---|---|
| <ImageIcon> | 1× | | lucide-react |
| <Layout> | 1× | | lucide-react |
| <Move> | 1× | | lucide-react |
| <Palette> | 1× | | lucide-react |
| <br> | 1× | | Native HTML |
| <button> | 3× | | Native HTML |
| <div> | 12× | | Native HTML |
| <h3> | 1× | | Native HTML |
| <label> | 1× | | Native HTML |
| <span> | 3× | | Native HTML |