BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/simple-ai/app-02

app-02

simple-ai/app-02
FreeBlock

A persona generator app with structured outputs.

Live preview

live · rendered by the registry
Rendered by simple-ai on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://simple-ai.dev/r/app-02.json

Source

./src/registry/blocks/app-02/page.tsxsimple-ai.dev/r/app-02.json
1"use client";
2
3import { experimental_useObject as useObject } from "@ai-sdk/react";
4import { zodResolver } from "@hookform/resolvers/zod";
5import { useState } from "react";
6import { useForm } from "react-hook-form";
7import { z } from "zod";
8import { Button } from "@/components/ui/button";
9import { Dialog, DialogContent } from "@/components/ui/dialog";
10import { Input } from "@/components/ui/input";
11import { Label } from "@/components/ui/label";
12import { Textarea } from "@/components/ui/textarea";
13import { PersonaDisplay } from "@/registry/blocks/app-02/components/persona-display";
14import { getRandomExample } from "@/registry/blocks/app-02/lib/example-businesses";
15import {
16 formSchema,
17 ProductPersonaSchema,
18 UserPersonaSchema,
19} from "@/registry/blocks/app-02/lib/persona";
20
21type FormData = z.infer<typeof formSchema>;
22
23export default function PersonaGenerator() {
24 const [showDialog, setShowDialog] = useState(false);
25
26 const {
27 register,
28 handleSubmit,
29 formState: { errors },
30 reset,
31 } = useForm<FormData>({
32 resolver: zodResolver(formSchema),
33 });
34
35 const { object, submit, isLoading } = useObject({
36 api: "/api/ai/persona",
37 schema: z.object({
38 userPersona: UserPersonaSchema,
39 productPersona: ProductPersonaSchema,
40 }),
41 });
42
43 const onSubmit = async (data: FormData) => {
44 setShowDialog(true);
45 submit(data);
46 };
47
48 const handleRandomize = () => {
49 const example = getRandomExample();
50 reset(example);
51 };
52
53 return (
54 <div className="max-w-3xl mx-auto p-6 space-y-8">
55 <div className="space-y-4 text-center">
56 <h4 className="text-3xl font-bold tracking-tight">
57 AI Persona Generator
58 </h4>
59 <p className="text-lg text-muted-foreground max-w-2xl mx-auto">
60 Generate detailed user and product personas for your
61 business using AI. Fill in the details below or try a random
62 example to get started.
63 </p>
64 </div>
65
66 <div className="flex justify-end">
67 <Button
68 variant="outline"
69 onClick={handleRandomize}
70 className="group"
71 >
72 <span className="mr-2 group-hover:animate-spin">🎲</span>
73 Try Random Example
74 </Button>
75 </div>
76
77 <div className="bg-card border rounded-lg p-6">
78 <form onSubmit={handleSubmit(onSubmit)} className="space-y-6">
79 <div className="grid gap-6 sm:grid-cols-2">
80 <div className="space-y-2">
81 <Label htmlFor="businessName">Business Name</Label>
82 <Input
83 id="businessName"
84 {...register("businessName")}
85// … truncated

What it pulls in

npm packages

  • ai
  • @ai-sdk/openai
  • zod

Other registry items

  • dialog
  • button
  • input
  • textarea
  • label
  • scroll-area
  • form
  • skeleton
  • card
  • avatar

Files it writes

  • ./src/registry/blocks/app-02/page.tsx
  • ./src/registry/blocks/app-02/route.ts
  • ./src/registry/blocks/app-02/components/persona-display.tsx
  • ./src/registry/blocks/app-02/lib/persona.ts
  • ./src/registry/blocks/app-02/lib/example-businesses.ts

Facts

Registry
simple-ai
Type
registry:block
Access
Free
Files written
5
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
yesterday

Go to the source

Docs on simple-ai simple-ai.dev Alwurts/simple-ai on GitHub Raw registry item This item as JSON

More from simple-ai

All 77 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
app-01app-01simple-aiBlocksFree5 deps · 11 files
app-03app-03simple-aiBlocksFree4 deps · 9 files
chat-01chat-01simple-aiBlocksFree3 deps · 16 files
chat-02chat-02simple-aiBlocksFree2 deps · 3 files
chat-03chat-03simple-aiBlocksFree2 deps · 3 files
chat-04chat-04simple-aiBlocksFree3 deps · 13 files
flow-chainflow-chainsimple-aiBlocksFree8 deps · 19 files
flow-orchestratorflow-orchestratorsimple-aiBlocksFree8 deps · 19 files
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex