← Inline AI Prompt API

Component · v2.6.0

NgbInlineAiPromptComponent

An inline text assistant that emits an instruction and context for a suggested edit.

Import

import { NgbInlineAiPromptComponent } from '@angular-bootstrap/ngbootstrap';

Selector:ngb-inline-ai-prompt

Usage notes

  • This is a presentation component. Your application owns provider requests, credentials, cancellation, persistence and error handling. Rendered response text is not executable HTML.

Declaration

Inputs

label

Visible heading or label for the component.

readonly label: i0.InputSignal<string>

context

Source text included with each submitted instruction.

readonly context: i0.InputSignal<string>

suggestions

Suggested prompts shown as buttons in the composer.

readonly suggestions: i0.InputSignal<readonly string[]>

response

Suggested replacement text displayed for review.

readonly response: i0.InputSignal<string>

error

Application-provided error message displayed to the user.

readonly error: i0.InputSignal<string>

busy

Marks a request in progress and prevents another submission. The application controls this state.

readonly busy: i0.InputSignal<boolean>

disabled

Disables user actions. This does not cancel an existing backend request.

readonly disabled: i0.InputSignal<boolean>

Outputs

promptSubmit

Emits an object containing instruction and context; the application generates the response.

readonly promptSubmit: i0.OutputEmitterRef<NgbInlineAiRequest>

responseApply

Emits the suggested replacement text and closes the panel. The application updates the source.

readonly responseApply: i0.OutputEmitterRef<string>

stop

Requests cancellation. The application must abort its backend request and clear busy.

readonly stop: i0.OutputEmitterRef<void>

closed

Emits when the panel closes. Focus returns to its trigger.

readonly closed: i0.OutputEmitterRef<void>

Properties

panelId

readonly panelId: string

Default:`ngb-ai-inline-${nextInlineId++}`

open

readonly open: i0.WritableSignal<boolean>

Methods

toggle

toggle(): void

request

request(instruction: string): void

apply

apply(): void

close

close(event?: Event): void

Referenced types

Source: src/ai/src/inline-ai-prompt.component.ts in the installed @angular-bootstrap/ngbootstrap package. Angular compiler metadata and private members are omitted.

This project is not affiliated with ng-bootstrap or ngx-bootstrap. Those projects focus mainly on Bootstrap components for Angular. ngbootstrap focuses on Angular UI for data-heavy apps, especially Data Grid, Angular-native Form Builder, drag and drop workflows, documentation examples, and performance-focused Angular patterns.