Icon

GitHub
Display icons from popular icon libraries to enhance your content.

Usage

Use the icon component to display an Icon in your content.

API

Props

Prop Default Type
name

string

Theme

app.config.ts
export default defineAppConfig({
  ui: {
    prose: {
      icon: {
        base: 'size-4 shrink-0 align-sub'
      }
    }
  }
})
vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'

export default defineConfig({
  plugins: [
    vue(),
    ui({
      ui: {
        prose: {
          icon: {
            base: 'size-4 shrink-0 align-sub'
          }
        }
      }
    })
  ]
})

Changelog

61b60 — feat: allow passing a component instead of a name (#4766)