For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
0
Sponsor

Auto Animate Pair

Two consecutive slides with auto-animate enabled for smooth transitions between states.

Before

function fibonacci(n: number): number {
  if (n <= 1) return n;
  return fibonacci(n - 1) + fibonacci(n - 2);
}

After

function fibonacci(n: number): number {
  const dp = [0, 1];
  for (let i = 2; i <= n; i++) {
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  return dp[n];
}

Installation

$ pnpm dlx shadcn@latest add @slidecn/auto-animate-pair

Usage

import AutoAnimatePair from "@/components/slides/auto-animate-pair";
import CodeBlock from "@/components/slides/code-block";
 
function MyPresentation() {
  return (
    <Deck>
      <AutoAnimatePair
        animateId="code-diff"
        from={
          <CodeBlock language="ts" autoAnimateId="code-diff">
            {codeBefore}
          </CodeBlock>
        }
        to={
          <CodeBlock language="ts" autoAnimateId="code-diff">
            {codeAfter}
          </CodeBlock>
        }
      />
    </Deck>
  );
}

API Reference

AutoAnimatePair

PropTypeDefaultDescription
animateIdstringrequiredShared auto-animate ID
fromReactNoderequiredFirst slide content
toReactNoderequiredSecond slide content
easingstring-Animation easing
durationnumber-Animation duration
notesstring-Speaker notes