Skip to content

Twitch

Seamlessly embed Twitch streams and chat into your documentation with our custom Twitch component.

Watch live!

Multiple Embed Types

Choose between stream-only, chat-only, or combined view

Theme Support

Automatic theme detection or manual dark/light selection

Interactive Controls

Built-in controls for mute, chat toggle, and fullscreen

Accessibility

Full ARIA support and keyboard navigation

Display both the stream and chat side-by-side for full engagement:

<TwitchEmbed
channel="kbve"
type="both"
theme="auto"
/>
PropTypeDefaultDescription
channelstringRequiredTwitch channel username
type'stream' | 'chat' | 'both''both'Type of embed to display
theme'dark' | 'light' | 'auto''auto'Color theme
widthnumber | string'100%'Width of the embed
heightnumber | string500Height of the embed
showControlsbooleantrueShow interactive controls overlay
autoplaybooleanfalseAuto-play stream on load
mutedbooleantrueStart stream muted
aspectstring'aspect-video'Aspect ratio CSS class
PropTypeDefaultDescription
channelstringRequiredTwitch channel username
theme'dark' | 'light' | 'auto''auto'Color theme
heightnumber | string500Height of the chat
darkpopoutbooleantrueForce dark popout mode
---
import TwitchEmbed from '@/components/twitch/TwitchEmbed.astro';
---
<TwitchEmbed channel="ninja" />
---
import TwitchEmbed from '@/components/twitch/TwitchEmbed.astro';
import TwitchChat from '@/components/twitch/TwitchChat.astro';
---
<div class="space-y-4">
<TwitchEmbed
channel="xqc"
type="stream"
autoplay={true}
muted={true}
/>
<TwitchChat
channel="xqc"
height={400}
/>
</div>
<TwitchEmbed
channel="lirik"
type="stream"
aspect="aspect-video"
showControls={true}
/>
<TwitchEmbed
channel="summit1g"
type="both"
theme="dark"
height={600}
muted={false}
/>

The Twitch embed component includes comprehensive accessibility support:

  • ARIA Labels: All interactive elements have descriptive labels
  • Keyboard Navigation: Full keyboard support for controls
  • Screen Reader Support: Status announcements for loading and state changes
  • Focus Indicators: Clear visual focus states
  • Reduced Motion: Respects user’s motion preferences
  • Lazy Loading: Embeds only load when visible in viewport
  • Skeleton Loading: Prevents layout shift with matching placeholders
  • Optimized Transitions: Smooth fade-ins without jank
  • Responsive Design: Adapts to all screen sizes

The Twitch embed component works in all modern browsers:

  • Chrome/Edge 90+
  • Firefox 88+
  • Safari 14+
  • Mobile browsers (iOS Safari, Chrome Mobile)
  • Streams start muted by default to comply with autoplay policies
  • Chat requires cookies to be enabled for authentication
  • Some streams may have geographic restrictions
  • Ad-blockers may interfere with stream playback

For advanced usage, you can interact with the component’s state:

// Access the Twitch service
import { twitchService } from '@/components/twitch/ServiceTwitch';
// Toggle chat visibility
twitchService.toggleChat();
// Toggle mute
twitchService.toggleMute();
// Set volume (0-1)
twitchService.setVolume(0.5);
// Toggle fullscreen
twitchService.toggleFullscreen();
Stream not loading?
  • Check if the channel name is spelled correctly
  • Verify the channel is currently live
  • Ensure cookies and JavaScript are enabled
  • Check for ad-blocker interference
Chat not appearing?
  • Twitch chat requires third-party cookies
  • Check browser privacy settings
  • Try refreshing the page
  • Ensure you’re not in incognito/private mode
Audio not working?
  • Streams start muted by default
  • Click the unmute button in controls
  • Check system volume settings
  • Verify browser audio permissions