Files
ianitor/packages/domi-ui/src/components/Icon.svelte
T

23 lines
590 B
Svelte

<script lang="ts">
import { icons, type IconName } from '../lib/icons';
interface Props {
name: IconName;
/** Draws the path in one stroke when it appears (the check of a finished action). */
draw?: boolean;
class?: string;
}
let { name, draw = false, class: cls = '' }: Props = $props();
</script>
<svg
class={['domi-icon', draw && 'domi-check-draw', cls]}
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.8"
stroke-linecap="round"
stroke-linejoin="round"
aria-hidden="true"
focusable="false"><path d={icons[name]} /></svg>