Cards Fancy Stable
TextRevealCard
Card that reveals text on horizontal mouse drag with animated star particles
Available for Svelte 5, React, and Vue 3.
Preview
svelte
<script lang="ts">
import { TextRevealCard } from "fancy-ui-svelte";
</script>
<TextRevealCard>
<p class="mb-4 text-lg font-bold text-white">Move your mouse to reveal</p>
{#snippet text()}
<p
class="bg-gradient-to-b from-white to-neutral-300 bg-clip-text py-6 text-[2rem] font-bold text-transparent md:text-[3rem]"
>
I know the secret
</p>
{/snippet}
{#snippet revealText()}
<p class="py-6 text-[2rem] font-bold text-white/10 md:text-[3rem]">Hover me to see</p>
{/snippet}
</TextRevealCard>Installation
pnpm add fancy-ui-svelte
import { TextRevealCard } from "fancy-ui-svelte";
Usage
svelte
<script lang="ts">
import { TextRevealCard } from "fancy-ui-svelte";
</script>
<TextRevealCard>
<p class="mb-4 text-lg font-bold text-white">Move your mouse to reveal</p>
{#snippet text()}
<p
class="bg-gradient-to-b from-white to-neutral-300 bg-clip-text py-6 text-[2rem] font-bold text-transparent md:text-[3rem]"
>
I know the secret
</p>
{/snippet}
{#snippet revealText()}
<p class="py-6 text-[2rem] font-bold text-white/10 md:text-[3rem]">Hover me to see</p>
{/snippet}
</TextRevealCard>Examples
Basic Usage
svelte
<script lang="ts">
import { TextRevealCard } from "$lib/fancy-ui/text-reveal-card";
</script>
<TextRevealCard>
<p class="mb-4 text-lg font-bold text-white">Move your mouse to reveal</p>
{#snippet text()}
<p
class="bg-gradient-to-b from-white to-neutral-300 bg-clip-text py-6 text-[2rem] font-bold text-transparent md:text-[3rem]"
>
I know the secret
</p>
{/snippet}
{#snippet revealText()}
<p class="py-6 text-[2rem] font-bold text-white/10 md:text-[3rem]">Hover me to see</p>
{/snippet}
</TextRevealCard>Fewer Stars
svelte
<script lang="ts">
import { TextRevealCard } from "$lib/fancy-ui/text-reveal-card";
</script>
<TextRevealCard starsCount={40}>
<p class="mb-4 text-sm text-neutral-400">Fewer stars, same effect</p>
{#snippet text()}
<p
class="bg-gradient-to-b from-white to-neutral-300 bg-clip-text py-6 text-[2rem] font-bold text-transparent md:text-[3rem]"
>
Less is more
</p>
{/snippet}
{#snippet revealText()}
<p class="py-6 text-[2rem] font-bold text-white/10 md:text-[3rem]">Minimalist</p>
{/snippet}
</TextRevealCard>Props
| Prop | Type | Default | Description |
|---|---|---|---|
starsCount | number | 130 | Number of star particles in the background |
starsClass | string | "" | CSS classes for the stars container |
Slots
| Slot | Description |
|---|---|
children | Content rendered above the reveal area (e.g., title) |
text | Text shown in the revealed layer (dragged to reveal) |
revealText | Text visible in the background star layer |
Links
Related components
AppleCardCarousel
Horizontal card carousel where the focused card expands into a spring-animated full-screen view
Cards Fancy
BentoGrid
Grid of framed tiles, each a hairline frame around a softly top-lit panel, where an accent glow rises from below on hover while the content lifts and the call to action slides in, and the tiles fade up in a stagger the first time the grid scrolls into view.
Cards Fancy
Book
3D book component with cover, spine, and back face that opens on hover
Cards Fancy