Skip to content
Agent UI
Provider composesCopy-paste blockmicrosoft-composeLive stage

Copilot Compose

A copy-paste block that recreates the Copilot prompt stage with Microsoft'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/microsoft-compose.tsx. The preview below is the real file, and the code tab is the exact source.

components/blocks/composes/microsoft-compose.tsx
MicrosoftCopilot
Sign inME

What can I help with?

Chat to find answers, create content, and complete tasks with AI.

Copilot is AI. It can make mistakes. Check important info.

The code tab contains the full block, ready to copy.

Installation

Add the block with the shadcn CLI. It writes components/blocks/composes/microsoft-compose.tsx and installs its dependencies.

bash
npx shadcn@latest add https://agent-ui-27t.pages.dev/r/microsoft-compose.json

Prefer to own the file manually? Install the dependencies, then copy the source from the Files section.

bash
pnpm add @agent-ui/react lucide-react

Tailwind 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.

tsx
import { MicrosoftCompose } from "@/components/blocks/composes/microsoft-compose";
 
<MicrosoftCompose 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/microsoft-compose.tsxtsx
tsx
"use client";
 
import * as React from "react";
import { ArrowUp, Globe, Mic, Plus } from "lucide-react";
import {
ComposeSendButton,
ComposeTextarea,
ModelChip,
createCompose,
useCompose,
type ComposeProps,
} from "@agent-ui/react";
 
const Root = createCompose({
id: "microsoft",
maxWidth: "max-w-none",
placeholder: "Message Copilot",
models: [
{ id: "copilot", name: "Copilot", hint: "Balanced" },
{ id: "copilot-think", name: "Copilot Think Deeper", hint: "Reasoning" },
{ id: "copilot-quick", name: "Copilot Quick", hint: "Fast" },
],
initialToggles: { search: false },
});
 
function CopilotMark({ className }: { className?: string }) {
return (
<svg viewBox="0 0 24 24" className={className} aria-hidden="true">
<defs>
<linearGradient
id="copilot-mark"
x1="2"
y1="3"
x2="22"
y2="21"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#2563eb" />
<stop offset="0.5" stopColor="#a855f7" />
<stop offset="1" stopColor="#f59e0b" />
</linearGradient>
</defs>
<path
d="M7.4 3.5h6.9a5.6 5.6 0 0 1 5.6 5.6v5.8a5.6 5.6 0 0 1-5.6 5.6H9.6a5.6 5.6 0 0 1-5.6-5.6v-4.4a7 7 0 0 1 3.4-6Z"
fill="url(#copilot-mark)"
/>
<path
d="M9 8.5c2.4-1.4 5.4-.2 6.3 2.3.9 2.5-.5 5.2-3 6"
stroke="#fff"
strokeOpacity="0.75"
strokeWidth="1.5"
fill="none"
strokeLinecap="round"
/>
</svg>
);
}
 
/** Microsoft Copilot: parchment canvas, editorial serif, multicolour gradient ring. */
function MicrosoftComposeLayout() {
const { toggles, toggle } = useCompose();
return (
<div className="relative flex min-h-[400px] w-full flex-col overflow-hidden bg-[#faf9f0] px-6 pb-5 pt-3 text-[13px] text-[#1b1b1b]">
<div className="relative flex items-center gap-2">
<span className="grid grid-cols-2 gap-[1.5px]" aria-hidden="true">
<span className="h-2 w-2 bg-[#f25022]" />
<span className="h-2 w-2 bg-[#7fba00]" />
<span className="h-2 w-2 bg-[#00a4ef]" />
<span className="h-2 w-2 bg-[#ffb900]" />
</span>
<span className="text-[11.5px] font-semibold">Microsoft</span>
<span className="h-3 w-px bg-black/20" aria-hidden="true" />
<span className="text-[12px] font-semibold">Copilot</span>
<div className="ml-auto flex items-center gap-2 text-[10.5px]">
<span className="text-black/60">Sign in</span>
<span className="grid h-6 w-6 place-items-center rounded-full border border-black/25 text-[8px] font-medium">
ME
</span>
</div>
</div>
 
<div
aria-hidden="true"
className="pointer-events-none absolute -right-8 top-16 h-24 w-24 rotate-12 rounded-3xl bg-[linear-gradient(135deg,#c084fc,#7c3aed)] opacity-25 blur-[1px]"
/>
<div
aria-hidden="true"
className="pointer-events-none absolute -left-10 bottom-10 h-20 w-20 -rotate-12 rounded-3xl bg-[linear-gradient(135deg,#7dd3fc,#2563eb)] opacity-20 blur-[1px]"
/>
<div
aria-hidden="true"
className="pointer-events-none absolute right-6 bottom-16 h-14 w-14 rotate-45 rounded-2xl bg-[linear-gradient(135deg,#fbbf24,#f97316)] opacity-20 blur-[1px]"
/>
 
<div className="relative my-auto flex w-full flex-col items-center pt-5">
<CopilotMark className="h-9 w-9" />
<h1 className="mt-3 text-center font-serif text-[30px] leading-tight tracking-[-0.02em]">
What can I help with?
</h1>
<p className="mt-1 text-center text-[11.5px] text-black/55">
Chat to find answers, create content, and complete tasks with AI.
</p>
 
<div
data-agent-id="compose-card"
className="mt-5 w-full max-w-[478px] rounded-full bg-[conic-gradient(from_140deg,#7c3aed,#2563eb,#06b6d4,#f59e0b,#ec4899,#7c3aed)] p-[1.5px] shadow-[0_3px_16px_rgba(37,99,235,0.14)] transition-shadow duration-200 focus-within:shadow-[0_5px_24px_rgba(37,99,235,0.24)]"
>
<div className="flex items-center gap-2 rounded-full bg-white py-1.5 pl-3 pr-1.5">
<CopilotMark className="h-5 w-5 shrink-0" />
<ComposeTextarea
aria-label="Message Copilot"
placeholder="Message Copilot"
rows={1}
className="min-w-0 flex-1 px-1 py-1 text-[13.5px] leading-5 placeholder:text-black/40"
/>
<button
type="button"
aria-label="Toggle web search"
aria-pressed={toggles.search}
onClick={() => toggle("search")}
className="grid h-7 w-7 shrink-0 place-items-center rounded-full text-black/45 hover:bg-black/5 aria-pressed:bg-[#eef2ff] aria-pressed:text-[#2563eb]"
>
<Globe className="h-3.5 w-3.5" aria-hidden="true" />
</button>
<ModelChip
tone="light"
className="hidden shrink-0 @[430px]:block [&>button]:h-7 [&>button]:px-1 [&>button]:text-[10.5px] [&>button]:text-black/50 [&>button]:hover:bg-black/5"
/>
<button
type="button"
aria-label="Start dictation"
className="hidden h-7 w-7 shrink-0 place-items-center rounded-full text-black/45 hover:bg-black/5 @[400px]:grid"
>
<Mic className="h-3.5 w-3.5" aria-hidden="true" />
</button>
<ComposeSendButton
aria-label="Send message"
className="h-7 w-7 shrink-0 bg-[#1b1b1b] text-white hover:bg-black disabled:bg-[#dedcd0] disabled:text-white disabled:opacity-100"
icon={<ArrowUp className="h-3.5 w-3.5" strokeWidth={2.4} />}
/>
</div>
</div>
 
<div className="mt-3 flex items-center gap-2">
<button
type="button"
aria-label="Attach"
className="flex items-center gap-1 rounded-full border border-black/10 bg-white/70 px-2.5 py-1 text-[10px] text-black/55"
>
<Plus className="h-3 w-3" aria-hidden="true" /> Add content
</button>
{["Create an image", "Help me write", "Make a plan"].map((label) => (
<button
key={label}
type="button"
className="rounded-full border border-black/10 bg-white/70 px-2.5 py-1 text-[10px] text-black/55 hover:bg-white"
>
{label}
</button>
))}
</div>
</div>
 
<p className="relative text-center text-[8.5px] text-black/35">
Copilot is AI. It can make mistakes. Check important info.
</p>
</div>
);
}
 
export function MicrosoftCompose(props: ComposeProps) {
return (
<Root {...props}>
<MicrosoftComposeLayout />
</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

All controls expose accessible names; the textarea supports Enter to send and Shift+Enter for a new line.

Copilot also has a full product page.

Metadata, model list, and the same block in a dedicated route.

Open Copilot
Use it with the rest of the library

MicrosoftCompose composes with MessageList, ChatShell, useChat, and the provider compose blocks. Browse the full reference or see all components in the gallery.

178 lines · copy-ready