# InlineAssistProps (@salmonui/chat/inline-assist)

> The InlineAssistProps interface of @salmonui/chat/inline-assist.

Canonical: https://salmonui.dev/docs/reference/chat/inline-assist/InlineAssistProps

```ts
import type { InlineAssistProps } from '@salmonui/chat/inline-assist';
```

Entry index: https://salmonui.dev/docs/reference/chat/inline-assist (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/chat/inline-assist.md).

## Reference

Kind: interface

```ts
interface InlineAssistProps {
    readonly anchor?: InlineAssistAnchor | null | undefined;
    readonly open?: boolean | undefined;
    readonly defaultOpen?: boolean | undefined;
    readonly onOpenChange?: ((open: boolean, event: InlineAssistOpenChangeEvent) => void) | undefined;
    readonly mode?: InlineAssistMode | undefined;
    readonly value?: string | undefined;
    readonly defaultValue?: string | undefined;
    readonly onValueChange?: ((value: string) => void) | undefined;
    readonly messages?: readonly InlineAssistMessage[] | undefined;
    readonly defaultMessages?: readonly InlineAssistMessage[] | undefined;
    readonly onMessagesChange?: ((messages: readonly InlineAssistMessage[], event: InlineAssistMessagesChangeEvent) => void) | undefined;
    readonly placeholder?: string | undefined;
    readonly adapter?: InlineAssistAdapter | undefined;
    readonly selection?: string | undefined;
    readonly onBeforeSend?: ((event: InlineAssistBeforeSendEvent) => void) | undefined;
    readonly onSend?: ((event: InlineAssistSendEvent) => void) | undefined;
    readonly onError?: ((error: unknown) => void) | undefined;
    readonly commands?: readonly InlineAssistCommand[] | undefined;
    readonly onCommandSelect?: ((event: InlineAssistCommandSelectEvent) => void) | undefined;
    readonly responseActions?: readonly InlineAssistResponseAction[] | undefined;
    readonly onResponseActionClick?: ((event: InlineAssistResponseActionEvent) => void) | undefined;
    readonly onAccept?: ((event: InlineAssistAcceptEvent) => void) | undefined;
    readonly onDiscard?: ((event: InlineAssistDiscardEvent) => void) | undefined;
    readonly toolbar?: ReactNode;
    readonly toolbarPlacement?: 'inline' | 'bottom' | undefined;
    readonly renderComposer?: ((props: InlineAssistComposerRenderProps) => ReactNode) | undefined;
    readonly renderContent?: ((text: string, options: InlineAssistContentOptions) => ReactNode) | undefined;
    readonly returnFocus?: boolean | undefined;
    readonly localeText?: InlineAssistLocaleText | undefined;
    readonly children?: ReactNode;
    readonly className?: string | undefined;
    readonly style?: CSSProperties | undefined;
    readonly 'aria-label'?: string | undefined;
    readonly 'aria-labelledby'?: string | undefined;
    readonly ref?: Ref<InlineAssistApi> | undefined;
}
```

Members (35):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `anchor` | `readonly anchor?: InlineAssistAnchor \| null \| undefined;` | optional | Element, text range, viewport point or element ref the popover is placed next to. |
| `open` | `readonly open?: boolean \| undefined;` | optional |  |
| `defaultOpen` | `readonly defaultOpen?: boolean \| undefined;` | optional | Applied after hydration (the server renders the assist closed). |
| `onOpenChange` | `readonly onOpenChange?: ((open: boolean, event: InlineAssistOpenChangeEvent) => void) \| undefined;` | optional |  |
| `mode` | `readonly mode?: InlineAssistMode \| undefined;` | optional | `'popover'` (default): an anchored top-layer popover. `'inline'`: rendered in place, in the flow of the page. |
| `value` | `readonly value?: string \| undefined;` | optional | Prompt text (controlled). |
| `defaultValue` | `readonly defaultValue?: string \| undefined;` | optional |  |
| `onValueChange` | `readonly onValueChange?: ((value: string) => void) \| undefined;` | optional |  |
| `messages` | `readonly messages?: readonly InlineAssistMessage[] \| undefined;` | optional | Prompt and response history (controlled). |
| `defaultMessages` | `readonly defaultMessages?: readonly InlineAssistMessage[] \| undefined;` | optional |  |
| `onMessagesChange` | `readonly onMessagesChange?: ((messages: readonly InlineAssistMessage[], event: InlineAssistMessagesChangeEvent) => void) \| undefined;` | optional |  |
| `placeholder` | `readonly placeholder?: string \| undefined;` | optional |  |
| `adapter` | `readonly adapter?: InlineAssistAdapter \| undefined;` | optional | Produces the response. |
| `selection` | `readonly selection?: string \| undefined;` | optional | Selected text passed in the request (default: the text of a `Range` anchor). |
| `onBeforeSend` | `readonly onBeforeSend?: ((event: InlineAssistBeforeSendEvent) => void) \| undefined;` | optional |  |
| `onSend` | `readonly onSend?: ((event: InlineAssistSendEvent) => void) \| undefined;` | optional |  |
| `onError` | `readonly onError?: ((error: unknown) => void) \| undefined;` | optional | The adapter threw. |
| `commands` | `readonly commands?: readonly InlineAssistCommand[] \| undefined;` | optional | Slash commands, shown as a `Menu` when the prompt starts with `/` or through `api.showCommands()`. |
| `onCommandSelect` | `readonly onCommandSelect?: ((event: InlineAssistCommandSelectEvent) => void) \| undefined;` | optional |  |
| `responseActions` | `readonly responseActions?: readonly InlineAssistResponseAction[] \| undefined;` | optional | Actions under a finished response. Default `['accept', 'discard', 'retry']`. |
| `onResponseActionClick` | `readonly onResponseActionClick?: ((event: InlineAssistResponseActionEvent) => void) \| undefined;` | optional |  |
| `onAccept` | `readonly onAccept?: ((event: InlineAssistAcceptEvent) => void) \| undefined;` | optional | Accept: insert `text` into the editor. Closes the assist. |
| `onDiscard` | `readonly onDiscard?: ((event: InlineAssistDiscardEvent) => void) \| undefined;` | optional | Discard: the response is dropped. Closes the assist. |
| `toolbar` | `readonly toolbar?: ReactNode;` | optional | Extra controls next to the prompt (`'inline'`, default) or in a row below it (`'bottom'`). |
| `toolbarPlacement` | `readonly toolbarPlacement?: 'inline' \| 'bottom' \| undefined;` | optional |  |
| `renderComposer` | `readonly renderComposer?: ((props: InlineAssistComposerRenderProps) => ReactNode) \| undefined;` | optional | Replaces the prompt input. |
| `renderContent` | `readonly renderContent?: ((text: string, options: InlineAssistContentOptions) => ReactNode) \| undefined;` | optional | Renders response text (default: plain text with line breaks). Never receives HTML; bring a Markdown renderer here. |
| `returnFocus` | `readonly returnFocus?: boolean \| undefined;` | optional | Return focus to the element focused before opening (the editor) on close. Default true. |
| `localeText` | `readonly localeText?: InlineAssistLocaleText \| undefined;` | optional |  |
| `children` | `readonly children?: ReactNode;` | optional | Parts in the composer row, such as `InlineAssist.Dictation`. |
| `className` | `readonly className?: string \| undefined;` | optional |  |
| `style` | `readonly style?: CSSProperties \| undefined;` | optional |  |
| `aria-label` | `readonly 'aria-label'?: string \| undefined;` | optional |  |
| `aria-labelledby` | `readonly 'aria-labelledby'?: string \| undefined;` | optional |  |
| `ref` | `readonly ref?: Ref<InlineAssistApi> \| undefined;` | optional |  |
