visual-overlay

Add visual animations (cursor, typing, click effects) to AgentPulse-enabled React apps. Use when: showing users what AI is doing, adding visual feedback for agent actions, configuring element targeting for animations.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "visual-overlay" with this command: npx skills add dang-hai/agentpulse/dang-hai-agentpulse-visual-overlay

Visual Overlay for AgentPulse

Add animated cursor, typing, and click effects to show users what the AI agent is doing.

Quick Start

Add VisualOverlay inside your AgentPulseProvider:

import { AgentPulseProvider, VisualOverlay } from 'agentpulse';

function App() {
  return (
    <AgentPulseProvider endpoint="ws://localhost:3100/ws">
      <VisualOverlay />
      <MyApp />
    </AgentPulseProvider>
  );
}

When an AI agent calls expose_set or expose_call, users see:

  • Animated cursor moving to the target element
  • Character-by-character typing for text inputs
  • Click ripple effects for button actions

Configuration

<VisualOverlay
  enabled={true}           // Master toggle (default: true)
  cursor={true}            // Show AI cursor (default: true)
  clickRipple={true}       // Show click effects (default: true)
  typingAnimation={true}   // Character-by-character typing (default: true)
  typingSpeed={12}         // Characters per second (default: 12)
/>

Element Targeting

The overlay finds elements using data-agentpulse-id attributes.

Naming Convention

Format: data-agentpulse-id="componentId-normalizedKey"

Where normalizedKey = binding key with set prefix removed, lowercased.

BindingNormalized KeyAttribute
setNamenamedata-agentpulse-id="form-name"
setEmailemaildata-agentpulse-id="form-email"
submitFormsubmitformdata-agentpulse-id="form-submitform"
setValuevaluedata-agentpulse-id="input-value"

Example

function ContactForm() {
  const [name, setName] = useState('');
  const [email, setEmail] = useState('');

  useExpose('contact-form', {
    setName: (v) => setName(v),
    setEmail: (v) => setEmail(v),
    submitForm: () => handleSubmit(),
  });

  return (
    <form>
      <input data-agentpulse-id="contact-form-name" value={name} />
      <input data-agentpulse-id="contact-form-email" value={email} />
      <button data-agentpulse-id="contact-form-submitform">Submit</button>
    </form>
  );
}

Auto-Discovery Fallback Chain

If data-agentpulse-id is missing, the resolver tries (in order):

  1. [data-agentpulse-id="componentId-normalizedKey"]
  2. Form container [data-agentpulse-id="componentId"] → input by name
  3. input[name="key"] or textarea[name="key"]
  4. getElementById(key) or getElementById("componentId-key")
  5. input[placeholder*="key"] (case-insensitive)
  6. [aria-label*="key"] (case-insensitive)
  7. Submit button detection for submitForm actions
  8. Open/close button detection for modal actions

Custom CSS Selectors

For complex layouts where auto-discovery fails:

<VisualOverlay
  targets={{
    'contact-form': {
      name: 'input[name="fullName"]',
      email: 'input[type="email"]',
      submit: 'button[type="submit"]',
    },
    'sidebar': {
      toggle: '#sidebar-toggle',
    },
  }}
/>

Or configure programmatically:

import { setAnimationConfig, clearAnimationConfig } from 'agentpulse';

setAnimationConfig({
  'my-form': {
    username: '#username-input',
    password: '#password-input',
  },
});

// Clear when done
clearAnimationConfig();

Common Patterns

Form with Multiple Fields

useExpose('signup-form', {
  setEmail: (v) => setEmail(v),
  setPassword: (v) => setPassword(v),
  submit: () => handleSubmit(),
});

// Add data attributes to each input
<input data-agentpulse-id="signup-form-email" />
<input data-agentpulse-id="signup-form-password" />
<button data-agentpulse-id="signup-form-submit">Sign Up</button>

Third-Party Component Libraries

For MUI, Chakra, etc., wrap or pass the data attribute:

// MUI TextField
<TextField
  inputProps={{ 'data-agentpulse-id': 'form-email' }}
  value={email}
  onChange={(e) => setEmail(e.target.value)}
/>

// Or use CSS selector config
<VisualOverlay
  targets={{
    'form': {
      email: '.MuiTextField-root input',
    },
  }}
/>

Search Box

useExpose('search', {
  query,
  setQuery,
  search: () => performSearch(),
});

<input data-agentpulse-id="search-query" />
<button data-agentpulse-id="search-search">Search</button>

Troubleshooting

IssueCauseSolution
Cursor goes to wrong elementKey mismatchCheck normalized key matches attribute
No animation on actionMissing attributeAdd data-agentpulse-id to element
Animation on wrong form fieldDuplicate attributesMake each attribute unique per component
Third-party input not foundNested DOM structureUse CSS selector config

Debug Targeting

Open browser console and look for resolver logs:

[TargetResolver] Found element for contact-form.name using selector: ...
[TargetResolver] Auto-discovered element for contact-form.email
[TargetResolver] No element found for contact-form.phone

Process

  1. Add VisualOverlay - Import and add inside AgentPulseProvider
  2. Identify target elements - Which inputs/buttons need animations?
  3. Add data attributes - Use data-agentpulse-id="componentId-normalizedKey"
  4. Test with agent - Call expose_set or expose_call and verify animations
  5. Configure fallbacks - Use CSS selectors for complex layouts

More Details

See references/TARGETING_PATTERNS.md for:

  • Full fallback chain explanation
  • Naming convention edge cases
  • Third-party component strategies
  • Debug techniques

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

agentpulse

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

agentpulse-setup

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

Awesome Cheatsheets

👩‍💻👨‍💻 Awesome cheatsheets for popular programming languages, frameworks and development tools. They awesome cheatsheets, javascript, backend, bash, chea...

Registry SourceRecently Updated
Coding

Appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and an appsmith, typescript, admin-dashboard, admin-panels, app...

Registry SourceRecently Updated