Prompt Bar
Install: npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/prompt-bar.json
When to use
Offer a compact or multi-line entry point for an agent prompt.
Key props and data
| Native prop | Meaning |
|---|---|
variant | Rounded or Pill chooses the native shape. |
demo | Set false for real user input so the scripted walkthrough does not run. |
tall | Places controls on a separate row for a multi-line surface. |
placeholder | Localized prompt hint. |
onSend | Receives trimmed text only. |
Interaction and state checks
Check both shapes with demo=false, text entry and send. Handle in-flight requests and errors in your business layer.
Integration boundaries
Model and attachment controls in the demo are not transmitted through onSend. Do not infer an upload/model backend from their appearance.
The runnable usage and source reference below preserve the native API. These practical guides do not claim a full translation of upstream prose.
Runnable usage
Install a complete example below first, then import its installed entry. Parameterized example source, shared helpers, native components and CSS are included; no manual relative-import edits are required.
import Demo from '@/components/beautiful-ui/examples/presets/prompt-bar-user-input';
import '@/styles/beautiful-ui.css';
export default function Example() { return <Demo />; }
Preview states
Rounded, Pill, User input, Multiline input
Demo state and mock data do not provide a backend service. Inspect the component props before wiring real data.
Composer with @ sources, / commands, model picker, and dictation.
Complete example installation
These are runnable native states and parameterized usage scenarios, not additional components. Each bundle includes its source closure, helpers, pinned dependencies, independent CSS and licenses. Scenario names are not new native component props; consult the source API below.
Rounded
npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/examples/prompt-bar/prompt-bar-rounded.json
Default import: @/components/beautiful-ui/examples/presets/prompt-bar-rounded
Dependencies: clsx@2.1.1, glimm@0.3.1, tailwind-merge@3.6.0, shadow-plugin@2.1.1
Pill
npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/examples/prompt-bar/prompt-bar-pill.json
Default import: @/components/beautiful-ui/examples/presets/prompt-bar-pill
Dependencies: clsx@2.1.1, glimm@0.3.1, tailwind-merge@3.6.0, shadow-plugin@2.1.1
User input
npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/examples/prompt-bar/prompt-bar-user-input.json
Default import: @/components/beautiful-ui/examples/presets/prompt-bar-user-input
Dependencies: clsx@2.1.1, glimm@0.3.1, tailwind-merge@3.6.0, shadow-plugin@2.1.1
Multiline input
npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/examples/prompt-bar/prompt-bar-multiline-input.json
Default import: @/components/beautiful-ui/examples/presets/prompt-bar-multiline-input
Dependencies: clsx@2.1.1, glimm@0.3.1, tailwind-merge@3.6.0, shadow-plugin@2.1.1
Initialize Tailwind CSS v4, import beautiful-ui.css once and synchronize theme with the host html dark class. Examples read html lang for Chinese/English and do not supply backend, authentication or recording. Network/clipboard availability still depends on the browser.
Source-backed parameter reference
Implementation signatures and types are generated from the pinned local source. Optional props, native inherited types, union branches and never exclusions are preserved. A forwardRef implementation's ref is a React reference, not an additional business prop.
PromptBar({
variant = "Rounded",
demo = true,
tall = false,
placeholder,
onSend,
}: {
variant?: string;
/** the self-running walkthrough; turn off when embedding in a real surface */
demo?: boolean;
/** hero sizing: a multi-line input with controls on their own row */
tall?: boolean;
placeholder?: string;
onSend?: (text: string) => void;
})
Destructuring defaults in source
Only defaults written directly in parameter/props destructuring are listed. Conditional expressions, runtime theme and computed values require source inspection; this is not an exhaustive behavior-default list.
// PromptBar
variant = "Rounded"
// PromptBar
demo = true
// PromptBar
tall = false