HeroUI Pro

Pressable Feedback

A press interaction layer adding ripple, highlight, hold-to-confirm, and progress feedback effects to any element.

Usage

Comparison

Disabled

Hold Confirm Callback

Hold Confirm Durations

Hold Confirm Sweep

Pressable Cards

Progress Feedback Callback

Progress Feedback Durations

Progress Feedback No Reset

Progress Feedback Sweep

Standalone Highlight

Standalone Ripple

With Highlight

With Hold Confirm

With Progress Feedback

With Ripple

CSS Classes

Base Classes

  • .pressable-feedback - Base pressable container with relative positioning and overflow hidden

Element Classes

  • .pressable-feedback__highlight - Opacity-based press overlay
  • .pressable-feedback__ripple - M3-style radial ripple container
  • .pressable-feedback__ripple-surface - Ripple animation surface with ::before (hover) and ::after (press) pseudo-elements
  • .pressable-feedback__hold-confirm - Clip-path hold-to-reveal overlay
  • .pressable-feedback__progress-feedback - Clip-path click-to-progress overlay

Interactive States

  • Focus visible: :focus-visible or [data-focus-visible="true"] on .pressable-feedback (focus ring)
  • Disabled: :disabled or [aria-disabled="true"] on .pressable-feedback (reduced opacity, no pointer events)
  • Hover: :hover or [data-hovered="true"] on parent activates .pressable-feedback__highlight opacity
  • Pressed: :active or [data-pressed="true"] on parent activates highlight pressed opacity

Data Attributes

  • [data-sweep="right|left|down|up"] on hold-confirm and progress-feedback - Clip-path sweep direction
  • [data-holding="true"] on .pressable-feedback__hold-confirm - Currently being held
  • [data-complete="true"] on hold-confirm/progress-feedback - Action completed
  • [data-progressing="true"] on .pressable-feedback__progress-feedback - Progress is active

CSS Variables

  • --pressable-feedback-highlight-color - Highlight overlay color (default: currentColor)
  • --pressable-feedback-highlight-opacity - Hover opacity (default: 0.08)
  • --pressable-feedback-highlight-pressed-opacity - Pressed opacity (default: 0.12)
  • --pressable-feedback-ripple-color - Ripple color (default: currentColor)
  • --pressable-feedback-ripple-hover-opacity - Ripple hover opacity (default: 0.08)
  • --pressable-feedback-ripple-pressed-opacity - Ripple pressed opacity (default: 0.12)
  • --pressable-feedback-hold-confirm-duration - Hold duration (default: 2000ms)
  • --pressable-feedback-hold-confirm-release-duration - Release snap-back duration (default: 200ms)
  • --pressable-feedback-progress-feedback-duration - Progress duration (default: 2000ms)
  • --pressable-feedback-progress-feedback-release-duration - Reset snap-back duration (default: 300ms)

API Reference

PressableFeedback

The root pressable container. Renders a button element by default.

PropTypeDefaultDescription
isDisabledbooleanfalseWhether the pressable is disabled
childrenReactNode-Feedback layers and content
classNamestring-Additional CSS class
renderDOMRenderFunction-Custom render function to override the default button element

Also supports all native button HTML attributes.

PressableFeedback.Highlight

Opacity-based hover/press overlay. No additional props beyond standard div attributes.

PressableFeedback.Ripple

M3-style radial ripple effect.

PropTypeDefaultDescription
durationnumber150Duration in ms for the ripple grow animation
hoverOpacitynumber0.08Opacity of the hover state
pressedOpacitynumber0.12Opacity of the pressed state
minimumPressDurationnumber225Minimum press duration in ms
isDisabledboolean-Whether the ripple is disabled
classNamestring-Additional CSS class
styleCSSProperties-Additional inline styles

PressableFeedback.HoldConfirm

Clip-path hold-to-reveal overlay.

PropTypeDefaultDescription
durationnumber2000Hold duration in ms before the action is confirmed
releaseDurationnumber200Duration in ms for the snap-back animation on release
sweep'right' | 'left' | 'down' | 'up''right'Which edge the clip-path reveal sweeps toward
resetOnCompletebooleantrueWhether to reset the overlay after the hold completes
isDisabledboolean-Whether the hold confirm is disabled
onComplete() => void-Fired when the hold reaches the full duration
childrenReactNode-Overlay content shown during the reveal
classNamestring-Additional CSS class

PressableFeedback.ProgressFeedback

Clip-path click-to-progress overlay (auto, no hold required).

PropTypeDefaultDescription
durationnumber2000Progress duration in ms before the action is confirmed
releaseDurationnumber300Duration in ms for the snap-back animation on reset
sweep'right' | 'left' | 'down' | 'up''right'Which edge the clip-path reveal sweeps toward
autoResetbooleantrueWhether to automatically reset after completing
resetDelaynumber1500Delay in ms before resetting after completion
isDisabledboolean-Whether the progress feedback is disabled
onComplete() => void-Fired when the progress reaches the full duration
onReset() => void-Fired when the overlay resets back to idle
childrenReactNode-Overlay content shown during the reveal
classNamestring-Additional CSS class

On this page