Ripple Effect
Material Design click ripple. Adds a circular wave effect emanating from the click/touch point for tactile UI feedback.

See Also

All JavaScript Effects Breathe Pulse Scribe Reveal Scramble Counter Shake Twinkle

Domma.effects.ripple()

The ripple() effect creates a Material Design-style circular wave expanding from the click/touch point. The ripple element is absolutely positioned, scales from 0 to 4x, and fades out. Perfect for buttons, cards, and interactive elements.

// Add ripple to all buttons
Domma.effects.ripple('.btn');

// Custom colour and duration
Domma.effects.ripple('.card', {
  colour: 'rgba(59, 130, 246, 0.3)',
  duration: 800,
  centered: false
});

// Clean up
ctrl.destroy();

Demo: Button Ripples

Click on these buttons to see the ripple effect. The ripple emanates from the click point.

Primary Success Danger Dark
Domma.effects.ripple('.btn', {
  colour: 'rgba(255, 255, 255, 0.35)',
  duration: 600
});

Demo: Custom Ripple Colours

Different ripple colours for different contexts.

Blue Ripple Green Ripple Red Ripple
Domma.effects.ripple('.blue', { colour: 'rgba(21, 101, 192, 0.3)' });
Domma.effects.ripple('.green', { colour: 'rgba(46, 125, 50, 0.3)' });
Domma.effects.ripple('.red', { colour: 'rgba(198, 40, 40, 0.3)' });

Demo: Centred Ripple

With centered: true, the ripple always starts from the centre of the element regardless of click position.

Click Anywhere
Domma.effects.ripple('.element', {
  centered: true
});

Demo: Card Ripples

Ripple effect on cards for interactive list items or dashboards.

Documents

24 files

Photos

148 files

Music

52 files

Domma.effects.ripple('.file-card', {
  colour: 'rgba(13, 110, 253, 0.15)',
  duration: 800
});

Demo: Duration Comparison

Compare different ripple durations.

Fast (300ms) Normal (600ms) Slow (1200ms)

Options Reference

OptionTypeDefaultDescription
colourstring'rgba(255, 255, 255, 0.35)'Ripple colour (CSS colour value)
durationnumber600Ripple animation duration in ms
opacitynumber0.35Starting opacity
unboundedbooleanfalseAllow ripple to overflow element
centeredbooleanfalseAlways ripple from centre
triggerstring'pointerdown''click', 'mousedown', 'pointerdown'
respectMotionPreferencebooleantrueHonour prefers-reduced-motion