Skip to content

ftxPrompt

Shows a prompt dialog with an input field.

Parameters

  • options (Object | String) - Prompt options or message string
    • message (String) - Prompt message (required if options is object)
    • title (String) - Dialog title (default: 'Prompt')
    • icon (String) - Icon to display
    • okLabel (String) - Label for OK button (default: 'Yes')
    • cancelLabel (String) - Label for Cancel button (default: 'No')
    • placeholder (String) - Input placeholder
    • defaultValue (String) - Default input value
    • $q (Object) - Optional Quasar instance

Returns

Dialog instance with event handlers:

  • onOk(callback) - Called when OK button clicked, receives input value
  • onCancel(callback) - Called when Cancel clicked
  • onDismiss(callback) - Called on any dismissal

Usage

javascript
import { ftxPrompt } from '@ftx/ui';

ftxPrompt({
  title: 'Enter Name',
  message: 'Please enter your name:',
  placeholder: 'Your name',
  defaultValue: ''
})
  .onOk((value) => {
    console.log('User entered:', value);
  })
  .onCancel(() => {
    console.log('Cancelled');
  });

Released under the MIT License.