# Compatibility

Application responsibilities, SSR, worker loading, and browser capabilities.

Page: https://sui.draco.dev/docs/compatibility

SUI targets React 19 and Tailwind CSS 4 with Base UI primitives. Source installation uses your application's aliases and CSS entrypoint; see [installation](/docs/installation). Modern CSS features, including OKLCH colors and backdrop filters, are part of the visual system.

## SSR and application state

The documentation site uses TanStack Start and SSR. Browser-dependent viewers and the code editor initialize after mounting, with base content or skeletons while loading. In an application with server and client component boundaries, keep interactive components on the client side and preserve installed `use client` directives.

Theme persistence, language routing, validation, and business requests belong to the application. ThemeToggle and LocaleToggle receive controlled values and callbacks. Blocks provide English defaults and accept `labels`; pass translations from your application's locale system. Use [Field](/docs/components/field) to compose labels, descriptions, and validation messages.

Components that render text for assistive technology also default to English and take that text as a prop: `closeLabel` on DialogContent, DialogFooter and SheetContent; `labels` on SidebarProvider; `label` on CarouselPrevious, CarouselNext, BreadcrumbEllipsis and PaginationEllipsis; `scrollLabels` on TabsList; `labels` on MessageScrollerButton; and `errorLabel` on QRCode.

## Code Editor workers

[Code Editor](/docs/components/code-editor) loads Monaco and its workers locally. Its installed source uses Vite-compatible `?worker` imports. A different bundler requires an equivalent worker integration; installing source does not configure that bundler automatically. Include the installed `worker.d.ts` in TypeScript's source paths.

CodeViewer and DiffViewer can still show and copy raw content if syntax highlighting fails. The code editor and viewers share the Shiki-based highlighting infrastructure.

## Lazy loading

`lazyComponent(() => import("./heavy"))` from `lib/lazy-component` wraps a heavy component (an editor, a chart, a viewer) in `React.lazy` and `Suspense` with an optional `fallback` prop. Unlike plain `React.lazy`, a failed load is not kept, so the next render, such as an error boundary's retry, loads again. `lib/stale-module` pairs with it after a release: `isStaleModuleError(error)` recognises a chunk that no longer exists, and `reloadForStaleModule()` reloads the page once a minute at most to pick up the new files. Viewer labels live in `viewers/code-labels` and `viewers/diff-labels`, and `chartKey` in `lib/chart-key`, so a lazy wrapper can import them without loading the heavy module.

## Browser features

| Feature | Application consideration |
| --- | --- |
| Clipboard | Browser permissions and a secure context determine availability; the components provide failure feedback. |
| Fullscreen | Browser fullscreen is optional; permission or platform restrictions can prevent entry. |
| Glass | Surfaces render with their theme background until the material is measured. SVG refraction by default, with a CSS material where SVG backdrops are unsupported (Safari), under reduced transparency, reduced motion or forced colors, or when rendering fails. |
| Haptics and sound | Off unless `FeedbackProvider` or a `feedback` prop enables them. Android uses the Vibration API, iOS 18+ the system switch click; both need a user gesture, and sound uses Web Audio. |
| Theme transitions | The toggle respects reduced motion and can apply the theme without a view transition. |
| HTML preview | HtmlViewer defaults to a sandbox with scripts allowed and without same-origin permission. Pass `sandbox="allow-same-origin"` in a Code Editor preview to disable scripts while keeping scroll sync. |

Glass refracts the live backdrop with SVG and captures nothing, so cross-origin images, frames, video and Canvas behind it need no special handling; see [Glass rendering](/docs/components/glass#rendering). A transparent surface needs to remain readable over its actual background; use the Regular material or an ordinary surface when needed.

## Accessibility and direction

Compose visible labels or accessible names for icon-only actions. Keep titles in dialogs, provide image descriptions, and use externally supplied labels for loading and feedback. Keyboard and focus behavior come from the underlying primitives; replacing native controls with custom markup can change those behaviors.

Use [Direction](/docs/components/direction) for RTL context and keep the application's `dir` attribute consistent. Loader, theme transitions and Motion-driven components such as Tabs, Bottom Sheet, Wheel Picker, charts and data table rows honor reduced-motion preferences; custom animations added by the application need the same consideration.

## Verification

After installation, run the consuming application's type checks and production build. Test its keyboard flow, forms, overlays, copy feedback, themes, and translated labels. The SUI documentation examples exercise components locally; they do not verify your application's routing, persistence, API requests, or deployment.
