AI SDK Agents
Full Stack AI Patterns
Complex AI Agents
Workflow Patterns
Tools + Artifacts
Configure AI behavior with custom instructions. Click the button below to manage your active instructions.
Active (1):
pnpm dlx shadcn@latest add https://cult-ui.com/r/ai-instructions.json
Use Instructions with instructions, onInstructionsChange, value, and onValueChange. Compose InstructionsTrigger, InstructionsContent (with InstructionsSearch, InstructionsList, InstructionsEmpty, InstructionsGroup, InstructionsItem), InstructionsFooter, InstructionsCreateTrigger, and InstructionsCreateDialog for the full experience.
import { useState } from "react"
import {
Instruction,
Instructions,
InstructionsTrigger,
InstructionsContent,
InstructionsSearch,
InstructionsList,
InstructionsEmpty,
InstructionsGroup,
InstructionsItem,
InstructionsFooter,
InstructionsCreateTrigger,
InstructionsCreateDialog,
} from "@/registry/default/ui/ai-instructions"
const instructions: Instruction[] = [
{
id: "concise",
title: "Be Concise",
description: "Keep responses short and to the point",
content: "Provide brief, focused responses. Get to the point quickly.",
},
]
export default function Example() {
const [activeIds, setActiveIds] = useState<string[]>(["concise"])
const [instructionsState, setInstructionsState] = useState(instructions)
return (
<Instructions
instructions={instructionsState}
onInstructionsChange={setInstructionsState}
value={activeIds}
onValueChange={setActiveIds}
>
<InstructionsTrigger />
<InstructionsContent>
<InstructionsSearch />
<InstructionsList>
<InstructionsEmpty />
<InstructionsGroup heading="Available Instructions">
{instructionsState.map((instruction) => (
<InstructionsItem
key={instruction.id}
instruction={instruction}
/>
))}
</InstructionsGroup>
</InstructionsList>
<InstructionsFooter>
<InstructionsCreateTrigger />
</InstructionsFooter>
</InstructionsContent>
<InstructionsCreateDialog />
</Instructions>
)
}value and onValueChangeInstructionsSearch filters the listonInstructionsChange, InstructionsCreateTrigger, and InstructionsCreateDialogInstructionsItem with content)