@get-asset/react

AssetAsk

Drop-in styled free-text ask: an “Ask something else” chip (the same anatomy as the insights question chips) that expands, in place, into a full-width input with a submit. The insights panel embeds it for you on the Profit & Loss and Cashflow Summary cards and the reports that embed the panel — reach for it directly only when attaching a free-text ask to something else. Renders nothing while the surrounding card is locked.

Preview

API reference

Root props

PropTypeDefaultDescription
onSubmit(question: string) => voidHandles a submitted question (already trimmed, never empty). The host decides what asking means — the insights panel wires it to its select().
placeholderstringPlaceholder (and accessible label) for the input. Pass a report-specific prompt. Defaults to "Ask about this report…".
disabledbooleanDisable the input + submit (e.g. while an answer generates).
lockedbooleanOverride the locked state. Defaults to the surrounding lockable card's state. While locked the component renders nothing.
defaultOpenbooleanStart on the expanded input instead of the chip — for storybook/docs previews of the expanded state.
maxLengthnumberCap the question length (native input maxLength). Pass your endpoint's limit — the insights panel passes 500, the insights endpoints' question cap.
classNamestringForwarded to the outer element of both states (chip and input row).

Behavior notes

  • Enter or the arrow button submits; the submit stays disabled until non-whitespace text is entered. Submitting collapses back to the chip and clears the field.
  • Escape or blurring while empty collapses back to the chip; blurring with a draft keeps the input open.
  • The expansion unfurls left→right over 260ms; users with reduced motion get an instant swap.
  • In a wrapping chip row the expanded input takes the full row width, so it always occupies its own line.