Skip to content

AI interfacesLumen Halo

Prompt ComposerProv1.0.0

Where a person writes to a model: a box that grows with the text, Enter to send and Shift+Enter for a new line, Send that becomes Stop while a reply runs, and files by the clip button, drag and drop or paste into an attachments slot.

Built on shadcn/ui

.md
pnpm dlx shadcn@latest add @beautiful-ui-pro/lumen-prompt-composer

Needs your registry key. Your components.json style picks the Base UI or Radix build: radix-*, new-york and default get Radix, base-* gets Base UI.

Styles didn't apply?

The CLI adds the styles to the CSS file named in components.json (tailwind.css). Check that it points at your global stylesheet, that the project uses Tailwind CSS v4, and that the file is imported in your root layout. Installed by hand: paste styles.css into that file.

Set up the Beautiful UI registry

Free pieces install from their URL with no setup (that URL gives the Base UI build; Radix projects use /r/radix-nova/<name>.json, or add the registries below and the CLI picks your build). Pro pieces need the registries below and BEAUTIFUL_UI_TOKEN in .env.local.

components.json
{
  "registries": {
    "@beautiful-ui": "https://beautiful-ui.dev/r/{style}/{name}.json",
    "@beautiful-ui-pro": {
      "url": "https://beautiful-ui.dev/r/pro/{style}/{name}.json",
      "headers": { "Authorization": "Bearer ${BEAUTIFUL_UI_TOKEN}" }
    }
  }
}

MCP server

claude mcp add --transport http beautiful-ui https://beautiful-ui.dev/api/mcp
Catalog for agents: /llms.txt
Running
Keyboard hint

Usage

Import it and pass your content. The props that matter most are listed next.

Example
"use client";

import * as React from "react";
import { PromptComposer } from "@/components/ui/lumen/controls/prompt-composer";
import { Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentTitle } from "@/components/ui/lumen/attachment";

export function AskBox({ send, stop, running }: { send: (text: string, files: File[]) => void; stop: () => void; running: boolean }) {
  const [files, setFiles] = React.useState<File[]>([]);
  return (
    <PromptComposer
      running={running}
      onStop={stop}
      hint
      onSubmit={({ text }) => {
        send(text, files);
        setFiles([]);
      }}
      onFiles={(added) => setFiles((all) => [...all, ...added])}
      accept="image/*,.pdf,.csv"
      attachments={
        files.length > 0 &&
        files.map((f) => (
          <Attachment key={f.name} size="sm">
            <AttachmentContent>
              <AttachmentTitle>{f.name}</AttachmentTitle>
            </AttachmentContent>
            <AttachmentActions>
              <AttachmentAction icon="close" aria-label={`Remove ${f.name}`} onClick={() => setFiles((all) => all.filter((x) => x !== f))} />
            </AttachmentActions>
          </Attachment>
        ))
      }
    />
  );
}

Props

  • value / defaultValue / onValueChange–

    string

    Controlled or not. Uncontrolled text clears after sending.

  • onSubmit–

    ({ text }) => void | boolean

    Send. Return false to keep the text (a validation failed).

  • running / onStop–

    boolean / () => void

    A reply is running: Send becomes Stop with a thin arc around it, Escape stops, Enter no longer sends.

  • onFiles / accept / multiple— / — / true

    (files: File[]) => void / string / boolean

    Shows the clip button; files also arrive by drop and paste. Show them in attachments.

  • attachments–

    ReactNode

    Above the text: the files waiting to go (Lumen Attachment fits).

  • tools–

    ReactNode

    Your controls in the footer (a model picker, a mode toggle).

Show all 12 props
  • submitOn"enter"

    "enter" | "mod-enter"

    mod-enter: Cmd/Ctrl+Enter sends and Enter is a new line (long-form prompts).

  • hintfalse

    boolean

    Show the keyboard hint in the footer (hidden on narrow screens).

  • canSubmitEmptyfalse

    boolean

    Allow sending with no text (attachments alone).

  • maxRows8

    number

    Rows the box grows to before it scrolls.

  • labels–

    Partial<PromptComposerLabels>

    input (the accessible name), send, stop, attach, drop, hint(mode, mac).

  • textareaRef–

    Ref<HTMLTextAreaElement>

    The textarea, to focus it from elsewhere.

Source

components/ui/lumen/controls/prompt-composer.tsx

This component is included with Pro.

Try the live preview above. Get Pro to install the source.