React SDK overview
React SPA, Next.js, and TanStack Start components for Rixl video, images, and media feeds.
@rixl/media-react works in ordinary client-rendered React applications as well as Next.js and TanStack Start. It provides Image, Video, Feed, and hooks for custom controls.
How the SDK fits together
- Core provides media fetching, uploads, player state, and reusable TypeScript utilities.
- Lit implements the media UI and its styles.
- React maps props, callbacks, refs, and player context to that shared UI.
Install the React package to get all three layers. Your app does not need a separate Lit configuration, CSS import, or Tailwind CSS setup.
Choose your integration
| Application | Package | Rendering |
|---|---|---|
| React SPA | @rixl/media-react | Client rendering |
| Next.js or TanStack Start | @rixl/media-react | Server-rendered hosts and browser media UI |
| Vue 3 | @rixl/media-vue | Vue component adapters |
| Svelte 5 | @rixl/media-svelte | Browser-compiled Svelte components |
| Angular 20+ | @rixl/media-angular | Standalone Angular components |
| Astro 7+ | @rixl/media-astro | Native Astro hosts and processed client scripts |
| Lit or vanilla JavaScript | @rixl/media-lit | Custom elements |
| Custom UI or uploads | @rixl/media-core | Headless APIs and stores |
Start with a media ID
Upload media through the Rixl dashboard, connect the SDK, then pass the image, video, or feed ID to a component. Published components resolve those IDs through the Rixl SDK.
Use component subpaths to include only what you need. An image-only import excludes video, feed, and HLS code. Video playback uses the package's HLS dependency or native browser support where applicable.
Rendering and styling
In a React SPA, React mounts the hosts and Lit renders their media contents in the browser. During SSR, React can render the hosts and supplied children on the server; media contents inside shadow DOM still render in the browser.
Set the host's dimensions using style or className. Internal styles are included in shadow DOM, so host classes do not style the player's internal controls.