Installation
1. Install the packages
Section titled “1. Install the packages”bun add typewritingclassbun add -d typewritingclass-compilerpnpm add typewritingclasspnpm add -D typewritingclass-compilernpm install typewritingclassnpm install -D typewritingclass-compiler2. Add the Vite plugin
Section titled “2. Add the Vite plugin”import { defineConfig } from 'vite'import twcPlugin from 'typewritingclass-compiler'
export default defineConfig({ plugins: [twcPlugin()],})For esbuild or Babel, see esbuild or Babel.
3. Import the generated CSS
Section titled “3. Import the generated CSS”import 'virtual:twc.css'4. Verify
Section titled “4. Verify”import { tw } from 'typewritingclass'
function App() { return <div className={tw.p(6).bg('blue-500').textColor('white').rounded('lg')}>It works!</div>}Start your dev server. You should see a blue rounded box with white text.
Next steps
Section titled “Next steps”- Quick Start — build your first component
- Editor Setup — VS Code hover previews