ProUnlock everything for $49.99 a year, or $79.99 once. See plans ›

Nexus UI

Ghost Autocomplete, animated React component

Inline AI autocomplete for a text box, where a grey suggestion fades in after your cursor when you pause. Tab inks it in from left to right, typing the same words makes it follow you, and typing something else drops the ghost letters away.

  • Pro
  • AI Components
  • Spring

Gives one quiet tick when Tab accepts a suggestion and stays silent while you type; autoplay makes the same tick once the visitor has used the page. Sound is off on this site until you switch it on.

Play with it

Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.

To: [email protected]Tab to accept

Pause typing for a suggestion

Props

PropTypeDefaultWhat it does
rulesGHOST_AUTOCOMPLETE_RULESPairs of [pattern, suggestion]. When the text ends with the pattern (use a $-anchored regex), the suggestion is offered after a short pause.
defaultValueGHOST_AUTOCOMPLETE_STARTWhat the box starts with.
to"[email protected]"The recipient line above the box.
onAcceptundefinedCalled with the suggestion text when Tab accepts it.
width480Width of the card in px. It never grows past its container.
autoplayfalseTypes a short script by itself, accepting one suggestion, following another and dropping a third, until someone touches the box. The script is written for the default rules and text. Only runs while on screen and never under reduced motion.
className""Extra classes for the card.
enableSoundtruePlays interface sounds on interaction. They follow the sound switch (setSoundsEnabled, on by default) and stay silent on hover. Autoplay makes the same sounds once the visitor has used the page. Pass false to silence this component.

Ghost Autocomplete questions

Does it make sound, and how do I turn it off?

Gives one quiet tick when Tab accepts a suggestion and stays silent while you type; autoplay makes the same tick once the visitor has used the page. Sounds are synthesised with the Web Audio API, so there are no audio files, and they only play after a click or key press. Pass `enableSound={false}` to silence this component, or call `setSoundsEnabled(false)` from `@/lib/ui-sounds` to switch every sound off at once. The CLI installs `@/lib/ui-sounds` with the component.