Skip to main content
NetScriptdocs Search docs ⌘K v0.0.9
Browse documentation

PromptInput

Chat composer: auto-grow textarea with a toolbar of research/grounding pills, model picker, attach/screenshot/voice, and send.

All components · Theme builder · Implementation source

Live preview

Open live prompt-input preview

Install

Shell
netscript ui:add prompt-input

Usage and examples

The preview runs this JSX with the installed components. Import any composed primitives from your UI directory.

TypeScript
import { useState } from 'preact/hooks';
import { PromptInput } from '@app/components/ui/prompt-input.tsx';

export function Example() {
  const [value, setValue] = useState('standard');
  const [open, setOpen] = useState(false);
  const [notice, report] = useState('');
  return (<><div><PromptInput placeholder="Ask about an order…" onSubmit={(text) => report(text)} /></div><p role="status">{notice}</p></>);
}

Props

Generated from native deno doc --json --private over the shipped implementation. Compound component props retain their owning interface; native attributes pass through where declared.

OwnerPropTypeOptionalDescription
PromptInputPropsplaceholderstringYes
PromptInputPropsonSubmit(text: string, meta: PromptSubmitMeta) => voidYes
PromptInputPropsmodelsModelOption[]Yes
PromptInputPropsmodelstringYes
PromptInputPropsonModelChange(id: string) => voidYes
PromptInputPropsgroundingbooleanYes
PromptInputPropsonGroundingChange(next: boolean) => voidYes
PromptInputPropsresearchbooleanYes
PromptInputPropsonResearchChange(next: boolean) => voidYes
PromptInputPropshintstringYes
PromptInputPropscompactbooleanYes
PromptInputPropsclassstringYes
PromptInputPropsonAttach() => voidYes
PromptInputPropsonScreenshot() => voidYes
PromptInputPropsonVoice() => voidYes
PromptInputPropsleadingActionsComponentChildrenYes
PromptInputPropstrailingActionsComponentChildrenYes
PromptInputPropsbusybooleanYes
PromptInputPropsonStop() => voidYes
PromptInputPropssendDisabledbooleanYes
PromptInputPropssubmitKeyPromptSubmitKeyYes
TypeScript
type PromptSubmitKey = [object Object]
PromptInputProps extends Omit<JSX.HTMLAttributes<HTMLFormElement>, "class" | "onSubmit">

Keyboard

KeyAction
EnterSubmit only with submitKey=enter and without Shift/IME composition; otherwise native text entry
Control+Enter/Meta+EnterSubmit with submitKey=mod-enter unless composing
Tab/Shift+TabMove through textarea and native controls
Enter/SpaceActivate focused action button

Tokens

Semantic contract roles: border/input, radius/card, space/inline/gap, space/stack/gap, surface/card, text/muted.

CSS custom properties referenced directly: --ns-border, --ns-border-hover, --ns-border-width, --ns-card, --ns-control-h, --ns-control-h-sm, --ns-control-height, --ns-control-height-sm, --ns-control-padding-x-sm, --ns-ease-fast, --ns-ease-normal, --ns-fg, --ns-focus-ring-offset, --ns-focus-ring-width, --ns-font-mono, --ns-font-sans, --ns-inline-gap, --ns-input-border, --ns-leading-body, --ns-leading-caption, --ns-leading-normal, --ns-marker, --ns-muted, --ns-muted-fg, --ns-primary, --ns-primary-border, --ns-primary-fg, --ns-primary-hover, --ns-primary-stroke, --ns-primary-subtle, --ns-radius-2xl, --ns-radius-card, --ns-radius-control, --ns-radius-full, --ns-radius-md, --ns-ring, --ns-selected, --ns-shadow-sm, --ns-space-1, --ns-space-1-5, --ns-space-2, --ns-space-2-5, --ns-space-3, --ns-space-px, --ns-stack-gap, --ns-state-disabled-opacity, --ns-state-pressed-opacity, --ns-text-2xs, --ns-text-body, --ns-text-caption, --ns-text-chat, --ns-text-sm, --ns-tracking-body, --ns-tracking-caption, --ns-weight-body, --ns-weight-caption.

Contract and compatibility

Accessibility pattern: native form, textarea and buttons

  • Native DOM attributes pass through where the implementation accepts them.
  • Utility compatibility anatomy is included for existing shipped helpers; it does not implement a design gap.

Design contract values marked planned are not implementation props. The props above describe what ships today.

Search all documentation

Type a term to search the documentation.