Skip to content
Oruga
Bulma
Bootstrap
Tailwind

Nuxt 3 ​

Oruga doesn't provide an official Nuxt module, but you can install it in a Nuxt 3 application using Nuxt's plugin system. Nuxt automatically discovers plugins in the plugins/ directory, so no manual registration is needed in nuxt.config.ts.

For instructions on creating a Nuxt app, see the Nuxt 3 installation guide. For details about plugin discovery, see the Nuxt 3 plugin documentation.

Install Oruga ​

bash
npm install @oruga-ui/oruga-next

Register Oruga ​

Create plugins/oruga.ts:

ts
import { createOruga } from "@oruga-ui/oruga-next";

export default defineNuxtPlugin((nuxtApp) => {
    nuxtApp.vueApp.use(createOruga());
});

This plugin is loaded automatically. Use a regular oruga.ts plugin so Oruga is installed for both server-side rendering and the client.

See the configuration and component documentation for configuration options.

Use components ​

Components are not registered globally by default. Import the components you need in your Vue single-file components:

vue
<script setup lang="ts">
import { OButton } from "@oruga-ui/oruga-next";
</script>

<template>
    <OButton>Oruga is ready</OButton>
</template>

If you prefer global components, import their component plugins and register them on the Oruga instance:

ts
import { Button, createOruga } from "@oruga-ui/oruga-next";

export default defineNuxtPlugin((nuxtApp) => {
    const oruga = createOruga();
    oruga.use(Button);
    nuxtApp.vueApp.use(oruga);
});

Register only the components you need to keep your bundle tree-shakeable. See the Introduction for more about component registration.

Add a theme ​

Oruga has no styles by default. To use the Oruga theme, install it:

bash
npm install @oruga-ui/theme-oruga

Add the stylesheet to nuxt.config.ts:

ts
export default defineNuxtConfig({
    css: ["@oruga-ui/theme-oruga/style.css"],
});

The Oruga theme uses Oruga's default class configuration, so adding its stylesheet is enough; keep the plugins/oruga.ts plugin from above.

You can also use your own styles instead or one of the other available themes.

Use framework based themes ​

Framework based themes like Bulma or Bootstrap provide both styles and a theme-specific Oruga configuration. Install the theme you want to use, for example Bulma:

bash
npm install @oruga-ui/theme-bulma

Replace the Oruga stylesheet in nuxt.config.ts with the stylesheet for the framework theme you installed. These stylesheets include the corresponding framework styles as well as Oruga's theme styles:

ts
export default defineNuxtConfig({
    css: ["@oruga-ui/theme-bulma/style.css"],
});

Then pass the theme's configuration to createOruga:

ts
import { createOruga } from "@oruga-ui/oruga-next";
import { bulmaConfig } from "@oruga-ui/theme-bulma";

export default defineNuxtPlugin((nuxtApp) => {
    nuxtApp.vueApp.use(createOruga(bulmaConfig));
});

See the themes documentation for configuration details on the other themes.

Use only one Oruga plugin: the framework theme config maps Oruga components to the framework's classes, while the stylesheet provides their visual styles. Unlike the default Oruga theme, these themes need the extra plugin configuration as well as CSS.

Custom Icons ​

Oruga's default icon pack is Material Design Icons. If you use it, install the font package and add its stylesheet alongside your theme stylesheet:

bash
npm install @mdi/font
ts
export default defineNuxtConfig({
    css: [
        "@oruga-ui/theme-bulma/style.css",
        "@mdi/font/css/materialdesignicons.min.css",
    ],
});

Released under the MIT License.