Skip to content
GetUrUI

Prompt Composers

4 variantsNewPro
.md

Four composers for AI products — an image prompt with references, a capsule that grows as you type, a playground with model and temperature controls and a metered box that prices each send.

aichatcomposerpromptinputtextareacreditstemperatureimage generation

Image prompt

image-prompt.tsx

Large image-prompt composer with drawn reference thumbnails, style chips, an aspect selector with a sliding thumb and an image counter.

$npx shadcn@latest add @geturui-pro/chat-composers-image-prompt
PropTypeDefaultDescription
onGenerate(request: ImagePromptRequest) => void—Called with { prompt, styles, aspect, count, references }.
generatingbooleanfalseTurns Generate into Stop.
onStop() => void—Called by the Stop button.
styles / defaultStylesstring[]—Chip options and the ones on at start.
maxStylesnumber3Most chips on at once; the oldest turns off.
aspects / defaultAspectAspectRatio[] / AspectRatio"4:5"Ratios offered and the initial one.
counts / defaultCountnumber[] / number[1, 2, 4] / 2Image counts offered.
defaultReferencesImagePromptReference[]—Initial reference chips ({ id, name, tone? }).
defaultValue / placeholderstring—Initial prompt and placeholder.

Capsule

capsule.tsx

Fully rounded single-line capsule that springs taller and softens its corners as text wraps; voice swaps to send once you type.

$npx shadcn@latest add @geturui-pro/chat-composers-capsule
PropTypeDefaultDescription
onSubmit(value: string) => void—Enter sends; Shift+Enter adds a line.
onAttach() => void—Shows the plus button.
onVoice() => void—Shows a voice button while the field is empty.
maxRowsnumber6Lines before the field scrolls.
placeholderstring"Message GetUrUI"Field placeholder.
disabledboolean—Disables the composer.

Playground

playground.tsx

Playground composer with a toolbar: model menu, temperature popover with presets and a slider, max-token switch and tool toggles.

$npx shadcn@latest add @geturui-pro/chat-composers-playground
PropTypeDefaultDescription
onRun(prompt: string, settings: PlaygroundSettings) => void—Run button or Cmd/Ctrl+Enter.
runningbooleanfalseTurns Run into Stop.
onStop() => void—Called by Stop.
modelsPlaygroundModel[]—Model menu options ({ id, label, description? }).
defaultSettingsPartial<PlaygroundSettings>—Initial { model, temperature, maxTokens, tools }.
onSettingsChange(settings: PlaygroundSettings) => void—Called on every settings change.

Metered

metered.tsx

Composer with a credit meter that previews the draft's cost as you type and ticks the balance down with a flying debit chip on send.

$npx shadcn@latest add @geturui-pro/chat-composers-metered
PropTypeDefaultDescription
credits / defaultCreditsnumber1240Controlled or initial balance.
maxCreditsnumber2000Plan size; the meter's scale.
estimateCost(text: string) => number—Cost of a draft. Default: 4 + 1 per 60 characters.
onSubmit(value: string, cost: number) => void—Called after a send.
onCreditsChange(credits: number) => void—Called with the new balance.
onTopUp() => void—Shows Top up when the balance runs low.
lowThresholdnumber0.15Fraction of the plan that turns the meter ember.
resetLabelstring"Resets Oct 1"Small print beside the meter.

Install the whole set

Installs every prompt composers variant at once. Each section above has its own command for a single variant.

Pro installs use your private registry token. Add the @geturui-pro registry once — setup guide. The command works after you get Pro.

$npx shadcn@latest add @geturui-pro/chat-composers

Accessibility

  • Every textarea is labelled; IME composition is respected before Enter or Cmd/Ctrl+Enter submits.
  • Chips and toggles use aria-pressed; aspect ratio, image count and token limits are radio groups; popovers close on Escape and return focus.
  • Icon buttons carry labels that describe the current action (send, stop, voice, remove).

Related