Plugins

Floating Prompt

Pro prompt positioning powered by Floating UI.

FloatingPromptPlugin

FloatingPromptPlugin is the direct Pro version of PromptPlugin. It keeps the same .prompt() API, but adds Floating UI based placement, collision handling, flipping, shifting, and automatic repositioning.

Demo

Installation

The plugin is included in the @cursor.js/pro package.

npm install @cursor.js/pro @cursor.js/core

Basic Usage

import { Cursor } from '@cursor.js/core';
import { FloatingPromptPlugin } from '@cursor.js/pro';

const cursor = new Cursor();
cursor.use(new FloatingPromptPlugin());

cursor.prompt('Continue?', {
  buttons: [{ label: 'Continue', onClick: 'continue', type: 'primary' }],
});

Without FloatingPromptPlugin

If you do not want to use the dedicated plugin class, you can attach the same positioning behavior to the core PromptPlugin manually:

import { Cursor, PromptPlugin } from '@cursor.js/core';
import { createFloatingPromptPositioner } from '@cursor.js/pro';

const cursor = new Cursor();
cursor.use(
  new PromptPlugin({
    positioner: createFloatingPromptPositioner(),
  }),
);

Options

Prop

Type