npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-composer.json --yesComposer
ProA box to write a prompt, a comment, a reply or an email in, with attachments and a send button, for React and Tailwind CSS. Part of Goop Pro.
What an agent sees
- ComposerHeaderThe row above the editor
- ComposerHeaderMarkThe header's mark
- ComposerHeaderTitleThe header's title
- ComposerHeaderActionsThe header's actions at its end, 12 px apart
- ComposerCloseThe close cross at the header's end
- ComposerFieldsThe email frame's field rows (To, From, Subject), each a
ComposerField, over the message - ComposerFieldOne field row
- ComposerFieldInputA field row's text box (To, Subject)
- ComposerFieldTriggerA field row's quiet picker trigger (From)
- ComposerEditorThe growing text box people write in
- ComposerToolbarThe row of buttons
- ComposerToolbarStartYour own controls at the toolbar's start (a mention, a format, a Saved replies menu), before its actions
- ComposerActionsThe buttons at the toolbar's end
- ComposerButtonA quiet round icon button sized for its frame, for your own controls in
ComposerToolbarStart(a mention, a format) orComposerActions - ComposerAttachThe paperclip button that opens the file chooser, in ComposerActions
- ComposerSubmitThe send button, last in ComposerActions (in the email frame, first in ComposerHeaderActions)
import {
ComposerHeader, ComposerHeaderMark, ComposerHeaderTitle, ComposerHeaderActions, ComposerClose, ComposerFields, ComposerField, ComposerFieldInput, ComposerFieldTrigger,
} from '@/components/ui/goop/composer';
import { useState } from 'react';
import {
Composer,
ComposerActions,
ComposerAttach,
ComposerButton,
ComposerEditor,
ComposerSubmit,
ComposerToolbar,
ComposerToolbarStart,
} from '@/components/ui/goop/composer';
function AskTheLog({ onAsk, onAttach }: { onAsk: (question: string) => void; onAttach: (files: File[]) => void }) {
const [question, setQuestion] = useState('');
return (
<Composer
aria-label="Ask the log"
onSubmit={(event) => {
event.preventDefault();
onAsk(question);
setQuestion('');
}}
>
<ComposerEditor
aria-label="Question"
placeholder="Ask about a field note…"
value={question}
onChange={(event) => setQuestion(event.currentTarget.value)}
/>
<ComposerToolbar>
<ComposerToolbarStart>
<ComposerButton icon="at-sign" aria-label="Mention someone" />
</ComposerToolbarStart>
<ComposerActions>
<ComposerAttach aria-label="Attach files" onFilesChange={onAttach} />
<ComposerSubmit aria-label="Send" disabled={!question.trim()} />
</ComposerActions>
</ComposerToolbar>
</Composer>
);
}Write a prompt (the box grows), attach a file or two, and send with the button or Ctrl/Cmd+Enter. The answer streams in; while it does the send button is Stop, which ends it where it is. At the start of the toolbar, the mention button adds @Teodora and the code button wraps the words as code; turn them off with Own controls at the start. Turn on Modes for a row of Ask and Note over the box: a note tints the box, and the line under it says which you picked. Switch the frame (default, comment, reply, compact) or turn the box off. The answer is a timer with three sample replies; attached files are listed by name, never read or sent; Teodora is a sample teammate; a note is answered like a question, never kept.
When to use
- A box to write a prompt, a comment, a reply or an email in, with attachments and a send button.
- Also called: message input or comment box.
Installation
Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Composer on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-composer.json --yesAdd the Goop Composer to this project. The install steps are at https://goop.so/docs/install.mdUsage
import {
ComposerHeader, ComposerHeaderMark, ComposerHeaderTitle, ComposerHeaderActions, ComposerClose, ComposerFields, ComposerField, ComposerFieldInput, ComposerFieldTrigger,
} from '@/components/ui/goop/composer';
import { useState } from 'react';
import {
Composer,
ComposerActions,
ComposerAttach,
ComposerButton,
ComposerEditor,
ComposerSubmit,
ComposerToolbar,
ComposerToolbarStart,
} from '@/components/ui/goop/composer';
function AskTheLog({ onAsk, onAttach }: { onAsk: (question: string) => void; onAttach: (files: File[]) => void }) {
const [question, setQuestion] = useState('');
return (
<Composer
aria-label="Ask the log"
onSubmit={(event) => {
event.preventDefault();
onAsk(question);
setQuestion('');
}}
>
<ComposerEditor
aria-label="Question"
placeholder="Ask about a field note…"
value={question}
onChange={(event) => setQuestion(event.currentTarget.value)}
/>
<ComposerToolbar>
<ComposerToolbarStart>
<ComposerButton icon="at-sign" aria-label="Mention someone" />
</ComposerToolbarStart>
<ComposerActions>
<ComposerAttach aria-label="Attach files" onFilesChange={onAttach} />
<ComposerSubmit aria-label="Send" disabled={!question.trim()} />
</ComposerActions>
</ComposerToolbar>
</Composer>
);
}- Fits: chat, inbox (their recipes).
- height, width, padding, gap, corner, border, background, shadow, text, motion: add no class for these.
API reference
- Each option with its sentence: composer--options.md
- State: mode (mode / defaultMode / onModeChange); drawn by data-focus-visible, data-state=off, data-state=open
| Part | What it is |
|---|---|
| ComposerHeader | The row above the editor |
| ComposerHeaderMark | The header's mark; its props: composer--header-mark.md |
| ComposerHeaderTitle | The header's title |
| ComposerHeaderActions | The header's actions at its end, 12 px apart |
| ComposerClose | The close cross at the header's end; its props: composer--close.md |
| ComposerFields | The email frame's field rows (To, From, Subject), each a ComposerField, over the message |
| ComposerField | One field row; its props: composer--field.md |
| ComposerFieldInput | A field row's text box (To, Subject); its props: composer--field-input.md |
| ComposerFieldTrigger | A field row's quiet picker trigger (From); its props: composer--field-trigger.md |
| ComposerEditor | The growing text box people write in; name it with aria-label, and Cmd or Ctrl+Enter sends; its props: composer--editor.md |
| ComposerToolbar | The row of buttons |
| ComposerToolbarStart | Your own controls at the toolbar's start (a mention, a format, a Saved replies menu), before its actions |
| ComposerActions | The buttons at the toolbar's end |
| ComposerButton | A quiet round icon button sized for its frame, for your own controls in ComposerToolbarStart (a mention, a format) or ComposerActions; its props: composer--button.md |
| ComposerAttach | The paperclip button that opens the file chooser, in ComposerActions; onFilesChange gets the files; its props: composer--attach.md |
| ComposerSubmit | The send button, last in ComposerActions (in the email frame, first in ComposerHeaderActions); while a reply streams it becomes the stop button; its props: composer--submit.md |
ComposerAttach
The paperclip button that opens the file chooser, in ComposerActions; onFilesChange gets the files.
import { ComposerAttach } from '@/components/ui/goop/composer';Options
- onFilesChange?: (files: File[]) => void — Called with the chosen files, each time a choice is made (the same file chosen again too).
- accept?: string — File types offered, as the input's
accept; any if left out. - children?: ReactNode — With
asChild: the one element that becomes the button, the paperclip drawn in it. - Also takes: asChild?: boolean; type?: 'button' | 'submit' | 'reset'; onClick?: (event: MouseEvent) => void; disabled?: boolean; aria-label: string; tooltip?: string | false; tooltipKeys?: readonly string[]; loading?: boolean = false; loadingLabel?: string = 'Loading'
ComposerClose
The close cross at the header's end.
import { ComposerClose } from '@/components/ui/goop/composer';Options
- aria-label?: string = 'Close' — The cross's name; "Close" by default.
- Also takes: onClick?: (event: MouseEvent) => void; disabled?: boolean; tooltip?: string | false; tooltipKeys?: readonly string[]; loading?: boolean = false; loadingLabel?: string = 'Loading'
ComposerEditor
The growing text box people write in; name it with aria-label, and Cmd or Ctrl+Enter sends.
import { ComposerEditor } from '@/components/ui/goop/composer';Options
- panelId?: string — The id of the editor's region as the ONE panel the header's tabs switch.
- variant?: 'default' | 'unstyled' | 'dialog' = 'unstyled' — The theme's Textarea look the editor wears:
unstyledthe composer's own bare line,defaultthe filled field,dialogthe notes line. - Also takes: value?: string; defaultValue?: string; onChange?: (event: ChangeEvent<HTMLTextAreaElement>) => void; name?: string; required?: boolean; disabled?: boolean; form?: string
ComposerFieldInput
A field row's text box (To, Subject).
import { ComposerFieldInput } from '@/components/ui/goop/composer';Options
- Also takes: value?: string; defaultValue?: string; onChange?: (event: ChangeEvent<HTMLInputElement>) => void; name?: string; required?: boolean; disabled?: boolean; form?: string
ComposerFieldTrigger
A field row's quiet picker trigger (From).
import { ComposerFieldTrigger } from '@/components/ui/goop/composer';Options
- Also takes: type?: 'button' | 'submit' | 'reset'; onClick?: (event: MouseEvent) => void; disabled?: boolean
ComposerField
One field row.
import { ComposerField } from '@/components/ui/goop/composer';Options
- label: ReactNode — The row's label ("To", "From", "Subject").
- htmlFor?: string — The id of the control the label names; one is made for the row's own parts when left out.
- children: ReactNode — The row's control.
ComposerHeaderMark
The header's mark.
import { ComposerHeaderMark } from '@/components/ui/goop/composer';Options
- icon?: IconName — The pack icon's name on the tile;
mailby default.
Composer: every option
import { Composer } from '@/components/ui/goop/composer';Options
- variant?: 'default' | 'comment' | 'reply' | 'compact' | 'email' | 'filled' — The frame:
default(the default) the prompt bar,commenta hairline frame,replya smaller frame,compactthe tight one a floating window holds,emailthe email panel (a header, field rows, the message),filledthe grey message box with its worded Send inside it. - disabled?: boolean = false — Disables the editor, the fields, the attach button, the send and the caller's toolbar controls; false by default.
- modes?: readonly ComposerMode[] — The kinds of message this composer writes (a reply, a note): shown as a row of options over the editor, on its start edge; a
variant: "note"mode tints the composer while chosen. - mode?: string — The chosen mode's value, controlled (with
onModeChange). - defaultMode?: string — The mode chosen first, uncontrolled; the first of
modesby default. - onModeChange?: (mode: string) => void — Called with a mode's value when the writer picks it.
- modesLabel?: string = 'Message type' — The modes row's name for a screen reader; "Message type" by default.
- Also takes: onSubmit?: (event: FormEvent) => void
- State: mode (mode / defaultMode / onModeChange); drawn by data-focus-visible, data-state=off, data-state=open
- Types: ComposerMode = { value: string; label: string; placeholder?: string; variant?: 'default' | 'note'; submitLabel?: string }
ComposerSubmit
The send button, last in ComposerActions (in the email frame, first in ComposerHeaderActions); while a reply streams it becomes the stop button.
import { ComposerSubmit } from '@/components/ui/goop/composer';Options
- children?: ReactNode | undefined — The send's words: drawn in the comment and email frames, its name in the arrow frames.
- aria-label?: string — The send's name where it has no words (required then); the arrow frames draw none.
- streaming?: boolean = false — A reply is streaming: the send is the stop, named
stopLabel, callingonStop. - onStop?: () => void — Called by a press of the stop while a reply streams; the form is never sent by it.
- stopLabel?: string = 'Stop' — The stop's name (and the worded frames' words) while a reply streams.
- Also takes: onClick?: (event: MouseEvent) => void; disabled?: boolean
Accessibility
- The native element answers the keyboard.
- hover, active, focus-within: the browser's own (:hover, :active, :focus-within): write nothing
Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:
| State | Drawn by |
|---|---|
| focus-visible | the attribute data-focus-visible |
| pressed | the attribute data-state=off |
| expanded | the attribute data-state=open |
| open | the attribute data-state=open |
| disabled | the prop disabled |
Motion
- The part sets its own motion: add no transition or animation of your own.
Notes for AI
Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.