Installation
-
Prerequisites
Section titled “Prerequisites”- Astro 4+ and Starlight 0.35+
- UnoCSS
-
Install the package
Section titled “Install the package”Terminal window npm i starlight-plugin-iconsTerminal window pnpm add starlight-plugin-iconsTerminal window yarn add starlight-plugin-iconsTerminal window bun add starlight-plugin-iconsTerminal window ni starlight-plugin-icons -
Replace Starlight with the plugin
Section titled “Replace Starlight with the plugin”Icons()
wraps the Starlight plugin, so replace your existingstarlight()
integration with it:astro.config.mjs import { defineConfig } from 'astro/config'import UnoCSS from 'unocss/astro'import starlight from '@astrojs/starlight'import Icons from 'starlight-plugin-icons'export default defineConfig({integrations: [UnoCSS(),starlight({title: 'My dull docs site',}),Icons({starlight: {title: 'My dull docs site',},}),],}) -
Add the UnoCSS preset
Section titled “Add the UnoCSS preset”uno.config.ts import { defineConfig } from 'unocss'import { presetStarlightIcons } from 'starlight-plugin-icons/uno'export default defineConfig({presets: [presetStarlightIcons()],}) -
Enable the features
Section titled “Enable the features”See the specific guides for each feature:
Or use components exported by
starlight-plugin-icons
: