Skip to content

Directives Overview

Directives are special attributes with the v- prefix that provide declarative DOM manipulation capabilities. In ume-ui, we provide several built-in directives to enhance user experience.

Available Directives

Here is a list of all available directives in ume-ui:

DirectiveDescription
v-rippleAdds Material Design ripple effects to interactive elements

Usage

All directives can be used in two ways:

When you import and install the entire ume-ui library, all directives are automatically registered globally:

js
import { createApp } from 'vue';
import UmeUi from 'ume-ui';

const app = createApp(App);
app.use(UmeUi);

Then you can use directives directly in your templates:

vue
<template>
  <button v-ripple>Click Me</button>
</template>

2. Individual Import

You can also import individual directives and register them manually:

js
import { ripple } from 'ume-ui';

// Register globally
app.directive('ripple', ripple);

// Or use in a single component
export default {
  directives: {
    ripple,
  },
};

Adding More Directives

We are continuously adding more useful directives to ume-ui. If you have a suggestion for a useful directive, please feel free to contribute or open an issue on our GitHub repository.

Next Steps

Explore the individual directive documentation to learn about their specific usage and features: