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

Qwen Compose

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

components/blocks/composes/qwen-compose.tsx

How can I help you?

Auto

By using Qwen, you agree to our Terms of Service and Privacy Policy.

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

Installation

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

bash
npx shadcn@latest add https://agent-ui-27t.pages.dev/r/qwen-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 { QwenCompose } from "@/components/blocks/composes/qwen-compose";
 
<QwenCompose 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/qwen-compose.tsxtsx
tsx
"use client";
 
import * as React from "react";
import { AudioLines, Globe, PanelLeft, Plus, Sparkles } from "lucide-react";
import {
ComposeSendButton,
ComposeTextarea,
ModelChip,
createCompose,
useCompose,
type ComposeProps,
} from "@agent-ui/react";
 
const Root = createCompose({
id: "qwen",
maxWidth: "max-w-none",
placeholder: "Message Qwen",
models: [
{ id: "qwen3-7-plus", name: "Qwen3.7-Plus", hint: "Flagship" },
{ id: "qwen3-max", name: "Qwen3-Max", hint: "Most capable" },
{ id: "qwen3-coder", name: "Qwen3-Coder", hint: "Code" },
],
initialToggles: { search: false, thinking: false },
});
 
/** Qwen Chat: gallery-white minimalism, giant capsule, equaliser send. */
function QwenComposeLayout() {
const { toggles, toggle } = useCompose();
return (
<div className="flex min-h-[400px] w-full flex-col bg-white px-6 pb-5 pt-3 text-[13px] text-[#1a1a1a]">
<div className="flex items-center gap-2">
<PanelLeft className="h-4 w-4 text-black/55" aria-hidden="true" />
<ModelChip
tone="light"
placement="bottom"
className="[&>button]:h-8 [&>button]:gap-1.5 [&>button]:px-1 [&>button]:text-[14px] [&>button]:font-semibold [&>button]:text-[#1a1a1a] [&>button]:hover:bg-black/5"
/>
<div className="ml-auto flex items-center gap-2">
<button
type="button"
className="rounded-full bg-[#1a1a1a] px-3.5 py-1.5 text-[10.5px] font-medium text-white"
>
Log in
</button>
<button
type="button"
className="rounded-full border border-black/10 px-3.5 py-1.5 text-[10.5px] font-medium"
>
Sign up
</button>
</div>
</div>
 
<div className="my-auto flex w-full flex-col items-center">
<h1 className="text-center text-[26px] font-normal tracking-[-0.01em] text-[#2b2b2b]">
How can I help you?
</h1>
 
<div
data-agent-id="compose-card"
className="mt-6 flex w-full max-w-[470px] items-center gap-2 rounded-full border border-[#e6e6f0] bg-white py-1.5 pl-4 pr-1.5 shadow-[0_2px_12px_rgba(80,80,160,0.06)] transition-[border-color,box-shadow] duration-200 focus-within:border-[#1a1a1a]/20 focus-within:shadow-[0_4px_20px_rgba(80,80,160,0.12)]"
>
<button
type="button"
aria-label="Attach"
className="grid h-7 w-7 shrink-0 place-items-center rounded-full text-[#1a1a1a] hover:bg-black/5"
>
<Plus className="h-[18px] w-[18px]" aria-hidden="true" />
</button>
<ComposeTextarea
aria-label="Message Qwen"
placeholder="Message Qwen"
rows={1}
className="min-w-0 flex-1 px-1 py-1.5 text-[14px] leading-5 placeholder:text-black/35"
/>
<span className="flex shrink-0 items-center gap-1 rounded-full px-2 py-1 text-[11px] text-black/55">
Auto
<svg viewBox="0 0 24 24" className="h-2.5 w-2.5" aria-hidden="true" fill="none">
<path d="m6 9 6 6 6-6" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
</svg>
</span>
<ComposeSendButton
aria-label="Send message"
className="h-8 w-8 shrink-0 bg-[#1a1a1a] text-white hover:bg-black disabled:bg-[#1a1a1a] disabled:text-white disabled:opacity-100"
icon={<AudioLines className="h-4 w-4" strokeWidth={2.2} />}
/>
</div>
 
<div className="mt-3 flex items-center gap-1.5">
<button
type="button"
aria-label="Toggle web search"
aria-pressed={toggles.search}
onClick={() => toggle("search")}
className="flex items-center gap-1 rounded-full border border-[#ececf2] px-2.5 py-1 text-[10px] text-black/45 hover:bg-black/[0.03] aria-pressed:border-black/15 aria-pressed:bg-black/[0.05] aria-pressed:text-black/80"
>
<Globe className="h-3 w-3" aria-hidden="true" /> Search
</button>
<button
type="button"
aria-label="Toggle thinking"
aria-pressed={toggles.thinking}
onClick={() => toggle("thinking")}
className="flex items-center gap-1 rounded-full border border-[#ececf2] px-2.5 py-1 text-[10px] text-black/45 hover:bg-black/[0.03] aria-pressed:border-black/15 aria-pressed:bg-black/[0.05] aria-pressed:text-black/80"
>
<Sparkles className="h-3 w-3" aria-hidden="true" /> Think
</button>
</div>
</div>
 
<p className="text-center text-[8.5px] text-black/30">
By using Qwen, you agree to our{" "}
<a href="#" className="underline">
Terms of Service
</a>{" "}
and{" "}
<a href="#" className="underline">
Privacy Policy
</a>
.
</p>
</div>
);
}
 
export function QwenCompose(props: ComposeProps) {
return (
<Root {...props}>
<QwenComposeLayout />
</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.

Qwen also has a full product page.

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

Open Qwen
Use it with the rest of the library

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

133 lines · copy-ready