nuxt-bootstrap-icons
Just a simple integration for Bootstrap Icons
Nuxt Bootstrap Icons
Just a simple integration for bootstrap-icons
Features
- A <
BootstrapIcon
/> component (the name can be changed) — this renders the icons - Different rendering modes for the icons —
inline
andcomponent
Setup
- Add
nuxt-bootstrap-icons
dependency to your project
# Using pnpmpnpm add -D nuxt-bootstrap-icons# Using yarnyarn add --dev nuxt-bootstrap-icons# Using npmnpm install --save-dev nuxt-bootstrap-icons
- Add
nuxt-bootstrap-icons
to themodules
section ofnuxt.config.ts
export default defineNuxtConfig({ modules: ["nuxt-bootstrap-icons"], // Optionally, customize the way of rendering icons bootstrapIcons: { renderType: "component", // or 'inline' (which is the default) },});
Usage
There are 2 ways of rendering icons:
inline
rendering: In this, you choose the icon to display using a name prop, for example:<template> <BootstrapIcon name="xbox" /></template>
component
rendering: Here the components are prefixed with BootstrapIcon and the name of the icon, for example:<template> <BootstrapIconXbox /></template>
That's it! You can now use nuxt-bootstrap-icons
in your Nuxt app ✨
Development
# Install dependenciespnpm install# Setup/sync icon componentspnpm setup# Generate type stubspnpm dev:prepare# Develop with the playgroundpnpm dev# Build the playgroundpnpm dev:build# Run ESLintpnpm lint# Release new versionpnpm release
Contributors 1