Function rippleFocus
- rippleFocus(
opts?: {
background?: string;
duration?: number;
enabled?: boolean;
selector?: string;
},
): Action<HTMLElement, ActionReturn<RippleFocus, Record<never, any>>>Parameters
Optionalopts: { background?: string; duration?: number; enabled?: boolean; selector?: string }Optional parameters.
Optionalbackground?: stringA valid CSS background attribute.
Optionalduration?: numberDuration in milliseconds.
Optionalenabled?: booleanEnabled state.
Optionalselector?: stringA valid CSS selector string.
Returns Action<HTMLElement, ActionReturn<RippleFocus, Record<never, any>>>
Actual
rippleFocusAction.
Defines the classic Material Design ripple effect as an action that is attached to an elements focus and blur events.
rippleFocusis 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.If providing the
selectoroption a target child element will be registered for the focus events otherwise the first child is targeted with a final fallback of the element assigned to this action.Styling: There is a single CSS variable
--tjs-action-ripple-background-focusthat can be set to control the background with a fallback to--tjs-action-ripple-background.