Code Example 8 - Live editing with typed codePro

A split editor and preview where code types itself character by character and the rendered preview updates as each prop lands, looping between examples; reduced motion shows the finished state. Use it to demonstrate a component API or theming config as if someone were editing live.

About Code Example 8

A split editor and preview where code types itself character by character and the rendered preview updates as each prop lands, looping between examples; reduced motion shows the finished state. Use it to demonstrate a component API or theming config as if someone were editing live.

Code Example 8 is a pro code example block for React, built on shadcn/ui and Tailwind CSS. It ships as 113 lines of TypeScript you own: every piece of copy is a prop with a sensible default, so you can drop it in and replace the content without touching the layout.

  • code
  • typing
  • live-preview
  • editor
  • animation
  • component

Installation

  1. Add the Chocolate UI registry to your components.json (see the installation guide).
  2. Run the shadcn CLI:
npx shadcn@latest add @chocolate/code-example-08

Uses: button, reveal, use-reduced-motion, utils.

Usage

import CodeExample08 from "@/components/blocks/code-example-08"

export default function Page() {
  return <CodeExample08 />
}

FAQ