Meta AI Compose
A copy-paste block that recreates the Meta AI prompt stage with Meta's rail, brand mark, prompt surface, model menu, and tool toggles. The block is not a package component: copy the file, or install it with the shadcn CLI, then edit the layout like any other file in your project. It is assembled entirely from Agent UI compose primitives, and every control is keyboard accessible.
Source you own: install the block with the shadcn CLI or copy components/blocks/composes/meta-compose.tsx. The preview below is the real file, and the code tab is the exact source.
Meta AI, the personal assistant that helps you create
The code tab contains the full block, ready to copy.
Installation
Add the block with the shadcn CLI. It writes components/blocks/composes/meta-compose.tsx and installs its dependencies.
npx shadcn@latest add https://agent-ui-27t.pages.dev/r/meta-compose.jsonPrefer to own the file manually? Install the dependencies, then copy the source from the Files section.
pnpm add @agent-ui/react lucide-reactTailwind CSS v4 users: add @source "../node_modules/@agent-ui/react/src" to the global stylesheet so the library utilities are generated.
Usage
Import the copied file and render it anywhere. The block accepts onSend, disabled, and className; wire onSend to any backend.
import { MetaCompose } from "@/components/blocks/composes/meta-compose"; <MetaCompose onSend={(text) => console.log(text)} />Files
One file. The same source is served by the shadcn registry endpoint, so the CLI and the docs can never drift.
components/blocks/composes/meta-compose.tsxtsx"use client"; import * as React from "react";import { ArrowUp, ChevronDown, Pencil, Plus } from "lucide-react";import { ComposeSendButton, ComposeTextarea, ModelChip, createCompose, type ComposeProps,} from "@agent-ui/react"; const Root = createCompose({ id: "meta", maxWidth: "max-w-none", placeholder: "Ask Meta AI anything...", models: [ { id: "llama-4", name: "Llama 4", hint: "Multimodal" }, { id: "llama-4-maverick", name: "Llama 4 Maverick", hint: "Fast" }, { id: "llama-3-1", name: "Llama 3.1", hint: "Open" }, ],}); function MetaFlower({ className }: { className?: string }) { return ( <svg viewBox="0 0 48 48" className={className} aria-hidden="true"> <defs> <linearGradient id="meta-flower" x1="6" y1="6" x2="42" y2="42" gradientUnits="userSpaceOnUse" > <stop stopColor="#8b5cf6" /> <stop offset="0.45" stopColor="#e879f9" /> <stop offset="1" stopColor="#3b82f6" /> </linearGradient> </defs> <g fill="url(#meta-flower)"> <ellipse cx="24" cy="10.5" rx="4.6" ry="8.8" /> <ellipse cx="37.5" cy="24" rx="8.8" ry="4.6" /> <ellipse cx="24" cy="37.5" rx="4.6" ry="8.8" /> <ellipse cx="10.5" cy="24" rx="8.8" ry="4.6" /> <ellipse cx="33.5" cy="14.5" rx="4" ry="7.5" transform="rotate(45 33.5 14.5)" /> <ellipse cx="33.5" cy="33.5" rx="4" ry="7.5" transform="rotate(-45 33.5 33.5)" /> <ellipse cx="14.5" cy="33.5" rx="4" ry="7.5" transform="rotate(45 14.5 33.5)" /> <ellipse cx="14.5" cy="14.5" rx="4" ry="7.5" transform="rotate(-45 14.5 14.5)" /> </g> </svg> );} /** Meta AI: white stage, gradient bloom, oversized editorial headline, soft capsule. */function MetaComposeLayout() { return ( <div className="relative flex min-h-[400px] w-full flex-col bg-white px-6 pb-5 pt-3 text-[13px] text-[#0a0a0a]"> <div className="flex items-center gap-2"> <MetaFlower className="h-5 w-5" /> <span className="text-[13px] font-semibold tracking-tight">∞ Meta</span> <div className="ml-auto flex items-center gap-2"> <button type="button" className="rounded-full bg-[#f0f0f0] px-3 py-1.5 text-[10.5px] font-medium" > Download app </button> <button type="button" className="rounded-full bg-[#5b5bf6] px-3.5 py-1.5 text-[10.5px] font-medium text-white" > Log in </button> </div> </div> <span className="absolute left-5 top-14 grid h-7 w-7 place-items-center rounded-full border border-black/10 text-black/50"> <Pencil className="h-3.5 w-3.5" aria-hidden="true" /> </span> <div className="my-auto flex w-full flex-col items-center pt-4"> <MetaFlower className="h-12 w-12" /> <h1 className="mt-4 max-w-[420px] text-center text-[27px] leading-[1.14] tracking-[-0.02em]"> Meta AI, the personal assistant that{" "} <span className="bg-gradient-to-r from-[#8b5cf6] via-[#d946ef] to-[#3b82f6] bg-clip-text text-transparent"> helps you create </span> </h1> <div data-agent-id="compose-card" className="mt-5 flex w-full max-w-[470px] flex-col rounded-[26px] border border-black/[0.05] bg-white p-3 shadow-[0_6px_26px_rgba(0,0,0,0.09)] transition-[box-shadow,border-color] duration-200 focus-within:border-[#8b5cf6]/30 focus-within:shadow-[0_10px_32px_rgba(139,92,246,0.16)]" > <ComposeTextarea aria-label="Message Llama" placeholder="Ask Meta AI anything..." rows={2} className="min-h-[42px] px-2 py-1 text-[14px] leading-6 placeholder:text-black/40" /> <div className="mt-1 flex items-center justify-between"> <div className="flex items-center gap-1"> <button type="button" aria-label="Attach" className="grid h-7 w-7 place-items-center rounded-full border border-black/15 text-black/65 hover:bg-black/5" > <Plus className="h-3.5 w-3.5" aria-hidden="true" /> </button> <ModelChip tone="light" className="[&>button]:h-7 [&>button]:px-1.5 [&>button]:text-[10.5px] [&>button]:text-black/45 [&>button]:hover:bg-black/5" /> </div> <ComposeSendButton aria-label="Send message" className="h-8 w-8 bg-[#b9b9fb] text-white hover:bg-[#a5a5f8] disabled:bg-[#dcdcfd] disabled:text-white disabled:opacity-100" icon={<ArrowUp className="h-[16px] w-[16px]" strokeWidth={2.4} />} /> </div> </div> <button type="button" className="mt-3 flex items-center gap-1.5 rounded-full bg-white px-3 py-1.5 text-[10.5px] shadow-[0_2px_10px_rgba(0,0,0,0.08)]" > Learn more <ChevronDown className="h-3 w-3" aria-hidden="true" /> </button> </div> </div> );} export function MetaCompose(props: ComposeProps) { return ( <Root {...props}> <MetaComposeLayout /> </Root> );} Built with
The block imports these Agent UI primitives. Each one is a package export with its own docs page, so you can change the layout without giving up the behaviour.
Accessibility
Meta AI also has a full product page.
Metadata, model list, and the same block in a dedicated route.
MetaCompose composes with MessageList, ChatShell, useChat, and the provider compose blocks. Browse the full reference or see all components in the gallery.
140 lines · copy-ready