Function ripple
- ripple(
opts?: {
background?: string;
contextmenu?: boolean;
debounce?: number;
duration?: number;
enabled?: boolean;
events?: Iterable<string>;
keyCode?: string;
},
): Action<HTMLElement, ActionReturn<Ripple, Record<never, any>>>Parameters
Optionalopts: {
background?: string;
contextmenu?: boolean;
debounce?: number;
duration?: number;
enabled?: boolean;
events?: Iterable<string>;
keyCode?: string;
}Optional parameters.
Optionalbackground?: stringA valid CSS background attribute.
Optionalcontextmenu?: booleanAdd triggering for context menu key and click.
Optionaldebounce?: numberAdd a debounce to incoming events in milliseconds.
Optionalduration?: numberDuration in milliseconds.
Optionalenabled?: booleanEnabled state.
Optionalevents?: Iterable<string>DOM event to bind element to respond with the ripple effect.
OptionalkeyCode?: stringKey code to trigger for any applicable key events.
Returns Action<HTMLElement, ActionReturn<Ripple, Record<never, any>>>
Actual
rippleAction.
Defines the classic Material Design ripple effect as an action.
rippleis a wrapper around the returned action. This allows it to be easily used as a prop.Note: A negative one translateZ transform is applied to the added spans allowing other content to be layered on top with a positive translateZ.
Note: The ripple effect requires the
efxelement to have overflow hidden. This is set inline when the effect is applied.Note: A CustomEvent
efx-triggeris handled in cases when explicit triggering is necessary. This event should have the actual source event as a property ofdetail.Styling: There is a single CSS variable
--tjs-action-ripple-backgroundthat can be set to control the background.