dimensionlab-website/packages/ui/src/components/IconGlyph.tsx

21 lines
456 B
TypeScript

import { Icon } from "@iconify/react";
export interface IconGlyphProps {
name?: string;
label?: string;
size?: "sm" | "md" | "lg";
}
export function IconGlyph({ name, label, size = "md" }: IconGlyphProps) {
return (
<span
className="icon-glyph"
data-size={size}
data-icon-name={name}
aria-label={label}
aria-hidden={label ? undefined : "true"}
>
{name ? <Icon icon={name} /> : null}
</span>
);
}