Files
frontend-svelte/src/shared/ui/Skeleton/Skeleton.svelte
T

28 lines
612 B
Svelte
Raw Normal View History

<!--
Component: Skeleton
Generic loading placeholder with shimmer animation.
-->
<script lang="ts">
import { cn } from '$shared/shadcn/utils/shadcn-utils';
import type { HTMLAttributes } from 'svelte/elements';
interface Props extends HTMLAttributes<HTMLDivElement> {
/**
* Whether to show the shimmer animation
*/
animate?: boolean;
}
let { class: className, animate = true, ...rest }: Props = $props();
</script>
<div
class={cn(
'rounded-md bg-background-subtle/50 backdrop-blur-sm',
animate && 'animate-pulse',
className,
)}
{...rest}
>
</div>