Ripple is an optional animation for the supported components such as buttons. It is disabled by default and needs to be enabled at your app's entry file (e.g. main.js) during the PrimeVue setup.
import { createApp } from 'vue';
import PrimeVue from 'primevue/config';
const app = createApp(App);
app.use(PrimeVue, { ripple: true });
Ripple describes how to use it with your own components and standard elements that needs to be imported and configured with a name of your choice. Global configuration is done with the app.directive function.
import Ripple from 'primevue/ripple';
app.directive('ripple', Ripple);
To start with, Ripple needs to be enabled globally. See the Configuration API for details.
mounted() {
this.$primevue.config.ripple = true;
}
Ripple is enabled by adding add p-ripple class to the target and attach the directive with the v- prefix.
<div v-ripple class="ripple-box">Default</div>
Ripple element has the aria-hidden attribute as true so that it gets ignored by the screen readers.
Component does not include any interactive elements.