- Implementation
- AppShell Props
- AppSurfaceHandle
Common Examples
To use theAppShell, pass the required chat region. Add header, rail, and artifact as needed. The kit forbids children. chat is always inline and never leaves the layout.Regions
A region shows inline when it fits and becomes a modal drawer when it cannot. The rail auto-yields before the artifact as the shell narrows.Initial visibility
defaultRailCollapsed and defaultArtifactCollapsed start a region collapsed on first paint, without a close transition.Artifact width
defaultArtifactWidth is "regular" (560px) or "large" (a 720px floor that fills available width and collapses the rail). It is a starting width only; the artifact stays drag-resizable.Auto-collapse
Dragging the artifact past the point where chat would hit its minimum detaches it into a drawer. Dragging back re-attaches it inline.useAppSurface
Region show, hide, and toggle live on AppSurfaceHandle. From a parent, pass controlRef. From inside the tree, call useAppSurface().open, maximize, …) are no-ops in a bare shell. isOpen and isFullscreen read true because the shell is the full surface.Internationalization
AppShell owns these localized strings:ai-kit.appShell.resizeRailai-kit.appShell.resizeArtifactai-kit.appShell.railDrawerai-kit.appShell.artifactDrawer
AiKitIntlProvider inside CartoTheme to switch them.React Accessibility
- Rail and artifact drawers expose localized names.
- Resize handles expose localized names for the rail and artifact.