Icon component
The <Icon>
component allows you to access a set of pre-installed icon libraries and use them in your documentation.
The two icon sets supported at the moment are:
Usage
You can draw a variety of different icon styles.
Rendering a book icon
<Icon set="lucide" name="book" size="sm" variant="plain" />
Basic
To use an icon, you must specify the set
and name
attributes.
<Icon set="devicon" name="python" />
The above will render the Python logo:
Color
Specifying the color
attribute will fill the icon with your theme's accent color.
<Icon set="devicon" name="rust" color />
Variant
You can also specify a plain
or boxed
variant. The latter will add some padding around your icon.
<Icon set="devicon" name="javascript" variant="boxed" />
Size
Finally, you can set a size
of sm
, md
, lg
, or xl
(the default is md
).
<Icon set="devicon" name="ruby" size="lg" />
Props
The component accepts the following props as attributes.