# Using Plugins

Add and configure plugins.

Every Vuesho feature is a plugin, like search, the sitemap and the API references. You add plugins in the config's `.plugins()`.

## Adding a Plugin [#adding-a-plugin]

Install the plugin's package, if it has one, and list the plugin in `.plugins()`. This example adds status badges to the sidebar:

```ts title="vuesho.config.ts"
import { createSite, recommendedPreset } from "vuesho/config";
import { defineDocs } from "vuesho/content";
import { statusBadgesPlugin } from "vuesho/status-badges"; // [!code ++]

const docs = defineDocs();

export default createSite(docs.toSource()).plugins(
  recommendedPreset(),
  statusBadgesPlugin(), // [!code ++]
);
```

`.plugins()` skips `false`, `null` and `undefined`, so a condition can turn a plugin on and off:

```ts title="vuesho.config.ts"
createSite(docs.toSource()).plugins(
  recommendedPreset(),
  process.env.ANALYTICS === "1" && analyticsPlugin(), // [!code highlight]
);
```

The build and the server both run `vuesho.config.ts`, so base the condition on something both can read, like an environment variable.

## Configuring the Preset [#configuring-the-preset]

`recommendedPreset()` returns the plugins that most sites want. Each key passes [options](/config#recommendedpreset) to its plugin, or turns the plugin off with `false`. `codeTabs` and `image` take only `false`:

```ts title="vuesho.config.ts"
createSite(docs.toSource()).plugins(
  recommendedPreset({
    codeTabs: false, // Code blocks with `tab` become tabs
    npm: {}, // `npm` code blocks become a tab per package manager
    search: {}, // Search with MiniSearch
    sitemap: {}, // sitemap.xml, which needs `site.baseUrl`
    robots: {}, // robots.txt
    rss: {}, // An RSS feed, which needs `site.baseUrl`
    llms: {}, // llms.txt and the Markdown version of each page
    linkValidation: {}, // Fail the build on a dead link
    image: false, // The image optimizers of Vercel and Netlify
  }),
);
```

## Replacing a Plugin [#replacing-a-plugin]

To replace one of the preset's plugins, turn off its key and add the other plugin:

```ts title="vuesho.config.ts"
import { algoliaPlugin } from "@vuesho/algolia"; // [!code ++]

createSite(docs.toSource()).plugins(
  recommendedPreset(), // [!code --]
  recommendedPreset({ search: false }), // [!code ++]
  algoliaPlugin({/* ... */}), // [!code ++]
);
```

When you add a preset plugin yourself, like `sitemapPlugin()` from `vuesho/config`, turn off the preset's copy so the same work doesn't run twice.

## Plugin Order [#plugin-order]

The built-ins run first, then the site's plugins in their order in `.plugins()`. A later plugin overrides an earlier one, and `.config()` options take priority over the plugins'. See [Plugin API](/plugin-api#plugin-order).

## Official Plugins [#official-plugins]

Built into `vuesho`, besides the recommended preset:

- `lucideIconsPlugin()` for [icon names](/navigation#icon-names), and `statusBadgesPlugin()` for [status badges](/navigation#status-badges)
- `stepsPlugin()`, `filesPlugin()` and `mermaidPlugin()` for [Steps](/markdown/components#steps), [Files](/markdown/components#files) and [Mermaid](/markdown/mermaid)
- `admonitionsPlugin()` for [containers and alerts](/markdown/components#containers-and-alerts)
- `ogImagePlugin()` for [Open Graph images](/seo#open-graph-images)

Packages:

- [Blog](/plugins/blog), [Changelog](/plugins/changelog), [Feedback](/plugins/feedback), [Graph View](/plugins/graph-view), and [EPUB and PDF](/plugins/epub-pdf)
- [Twoslash](/markdown/twoslash), [Type Tables](/markdown/type-tables) and [Stories](/markdown/stories)
- [AI chat and MCP server](/ai)
- [Search services](/search/services): Algolia, Orama Cloud, Meilisearch, Typesense and Mixedbread
- [API docs](/api-docs/openapi): OpenAPI, GraphQL, AsyncAPI and Python
- [Content sources](/content-sources): Notion, Sanity, Obsidian and local files
- [Mintlify](/migrating/mintlify), to run a Mintlify project

To write a plugin, see [Plugin API](/plugin-api).
