@vite-tts/solid
v0.1.0
Published
SolidJS component for vite-plugin-tts
Readme
@vite-tts/solid
SolidJS component for
vite-plugin-tts.
Provides fine-grained reactive TTS audio playback without React JSX overhead or heavy runtime dependencies.
📦 Installation
pnpm add @vite-tts/solid
# or
npm install @vite-tts/solid🚀 Usage
import { TTS } from '@vite-tts/solid'
export function App() {
return (
<main>
<h1>SolidJS TTS Demo</h1>
{/* Pre-generated static audio */}
<TTS
text="Welcome to SolidJS with Vite TTS!"
src="/tts-audio/welcome.wav"
controls={true}
/>
{/* Web Speech fallback */}
<TTS
text="नमस्ते SolidJS!"
lang="hi-IN"
controls={true}
/>
</main>
)
}⚙️ Props
| Prop | Type | Default | Description |
|---|---|---|---|
| text | string | Required | Text content to be spoken |
| src | string | undefined | Static audio URL pre-generated by vite-plugin-tts |
| lang | string | 'en-US' | Language tag for speech synthesis fallback |
| voice | string | undefined | Voice identifier |
| controls | boolean | true | Show default native audio controls |
| autoplay | boolean | false | Enable autoplay |
| loop | boolean | false | Enable looping |
| muted | boolean | false | Start muted |
| class | string | undefined | CSS class name |
📄 License
MIT
