Prosefly

Components

Icon

Render Iconify icons in Astro and MDX content.

Use Icon for small visual cues in content: card icons, inline labels, and status descriptions. Use the prefix:name format from Iconify, such as lucide:sparkles or simple-icons:github.

Import

mdx
import { Icon } from '@prosefly/astro-components';

Inline Icons

Reusable MDX components for Astro documentation.

mdx
<p><Icon name="lucide:sparkles" /> Reusable MDX components for Astro documentation.</p>

Accessible Icons

Decorative icons are hidden from assistive technology by default. Add title when the icon itself carries meaning.

Warning Check the setup before continuing.

mdx
<p><Icon name="lucide:triangle-alert" title="Warning" /> Check the setup before continuing.</p>

Icon Integration

Register the proseflyComponents() integration when a standalone Astro project needs Iconify scanning and preloading.

astro.config.ts
import { defineConfig } from 'astro/config';
import proseflyComponents from '@prosefly/astro-components/integration';
export default defineConfig({
integrations: [
proseflyComponents({
icons: {
preload: ['lucide:sparkles', 'simple-icons:github'],
},
}),
],
});

The integration always includes icons used internally by the package components. It also scans src/**/*.astro, src/**/*.md, and src/**/*.mdx for static name and icon prop values by default. Add dynamic icon names to preload, because the scanner only sees literal strings.

OptionTypeDefault
preloadstring[][]
scanbooleantrue
apiBasestringhttps://api.iconify.design

Set scan: false when a site should preload only the icons listed in preload, or set apiBase to use an internal Iconify-compatible endpoint.

Prosefly theme defaults

Dahlia and Lotus already register the shared integration and scan src/**/*.astro, src/**/*.md, and src/**/*.mdx for static icon names. Theme projects do not need another proseflyComponents() entry.

Props

PropTypeDefault
namestringrequired
titlestringnone
sizenumber | stringnone
widthnumber | stringsize ?? '1em'
heightnumber | stringsize ?? '1em'
apiBasestringhttps://api.iconify.design

Last updated Sep 1, 2026