Skip to content

    Browse components

    Ask Box

    AI prompt input that grows with your text, holds springy attachment chips, and morphs its send arrow into a stop button ringed by a spinner while generating.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/ask-box

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/ask-box.json

    Usage

    import { AskBox } from "@/components/ui/ask-box";
    
    <AskBox
      onSubmit={(text, files) => streamAnswer(text, files)}
      onStop={() => controller.abort()}
    />

    Props

    PropTypeDefaultDescription
    placeholderstring"Ask anything…"Placeholder text.
    maxRowsnumber6Lines the field grows to before it scrolls.
    generatingbooleanfalseForce the generating state.
    onSubmitReactNode—(text, files) => void | Promise. A returned promise shows the generating state until it settles.
    onStopReactNode—Called when stop is pressed while generating.
    defaultFilesReactNode—Files attached on mount.
    classNamestring—Extra classes for the root element.