master
1---
2import { Icon as AstroIcon } from 'astro-icon/components';
3
4interface Props {
5 name: string;
6 size?:
7 | string
8 | {
9 width: string;
10 height: string;
11 };
12}
13
14const { name, size } = Astro.props;
15let width = '1.25em';
16let height = '1.25em';
17if (size) {
18 if (typeof size === 'string') {
19 width = size;
20 height = size;
21 } else {
22 width = size.width;
23 height = size.height;
24 }
25}
26---
27
28<AstroIcon
29 name={name}
30 class="inline align-text-bottom"
31 width={width}
32 height={height}
33 is:inline
34/>