App at the root of every toolkit application and wrap all application content with it. App registers the text font, scopes the stylesheet reset and base typography, establishes directional navigation and automatic initial focus, mounts the toast presenter, and creates the portal root for tooltips, menus, and other floating interface elements. Keeping these responsibilities in one root makes focus, platform-aware interaction feedback, and overlays consistent across the application.App fills its parent, so the host page must provide a box with a real size. Prefer layouts based on the available viewport rather than a fixed viewport size so content remains responsive.App around the routed application. It loads the packaged stylesheet.import { createRoot } from 'react-dom/client';
import { App } from '@wearables-ui-toolkit/mrbd';
import { AppRoutes } from './AppRoutes';
function Root() {
return (
<App>
<AppRoutes />
</App>
);
}
createRoot(document.getElementById('root')!).render(<Root />);
App loads the packaged component styles, semantic token custom properties, and typography classes automatically.App has space to fill, and use the window background role for the document:html,
body,
#root {
height: 100%;
margin: 0;
background-color: var(--uit-color-background-window);
}
App already paints this background on its root. Applying it to the document as well prevents areas outside App, such as space exposed by overscroll, from showing the browser’s default white.className or style on the outer root for an application-wide inset or background. App preserves its sizing unless your values override those properties:<App className="app-shell" style={{ padding: 'var(--uit-spacing-medium)' }}>
<AppRoutes />
</App>
App is also available from its component subpath:import { App } from '@wearables-ui-toolkit/mrbd/App';
AppProps.| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Required application content. All content rendered with the toolkit must be inside App. |
className | string | — | Class applied to the outer root element. |
style | CSSProperties | — | Inline styles merged over the root’s positioning and sizing styles. Values supplied by the application take precedence for the same property. |
App accepts no other DOM props and does not forward a ref.App registers Noto Sans in the regular, medium, and bold weights used by the design system. It checks for an installed copy first by registering local-only font faces ahead of the downloadable family. On its first mount, App appends the Google Fonts stylesheet link and preconnect hints; the browser fetches font files only when no local copy is installed. No font package is needed, and the toolkit registers no other family.App.App supplies the Meta Ray-Ban Display platform profile to its subtree. Components such as Container and Surface read this profile automatically when calculating their default content scale, so applications do not pass a platform value to individual components.App scopes the focus-navigation provider to its content and enables automatic initial focus. On mount, and when the focused element is removed, the toolkit focuses the top-left eligible interactable. The toolkit skips elements without a measured box and elements with initialFocusEligible={false}. If nothing else has focus on mount, App focuses its content element to give directional navigation a starting point.App owns the toast container. Use the toast API to show a toast; mounting another presenter is unsupported because it can produce duplicate or inconsistent announcements.App provides an absolutely positioned overlay layer inside the content element. The layer sits above ordinary content and ignores pointer events while tooltips, context menus, vertical menus, and other floating interface elements render through it. Replacing this provider is unsupported because the toolkit owns consistent overlay placement and focus scope.App uses the content element as the boundary for anchored tooltips, keeping them within the application viewport.style; values supplied there take precedence over the root’s own styles for the same properties.App inserts the font faces and stylesheet link into the document head once and leaves them in place. Registration is keyed to the injected stylesheet, so remounting App, or rendering more than one, does not duplicate them. During server rendering, when no document exists, App skips registration.App and preserves native Tab traversal so keyboard and assistive-technology users are not trapped. App fixes the provider settings and exposes no tuning props. If an embedded host temporarily parks document focus on an unowned application ancestor, the toolkit restores the current interactable instead of clearing its visual focus state. Render a nested FocusNavigationProvider only when a subtree needs a different container or arrow-key-only traversal.App is memoized and re-renders only when children, className, or style changes. Prefer keeping application state below App so updates do not recreate the root.App scopes each service it installs to its subtree. A nested App would create another focus root, toast presenter, and portal root, so this composition is unsupported.App does not add roles, landmarks, or accessible names.App at the top of the tree, above the router, so the toolkit has one consistent focus and overlay root.App load the component styles, semantic tokens, and typography classes.App can fill it responsively.App own the platform profile, toasts, floating portals, and initial focus.App so fonts, focus, toasts, and portals remain coordinated.App. Multiple roots are an unsupported composition and create competing focus, toast, and portal ownership.App owns both services for its subtree.