Skip to main content

API

The top-level surface: showing a screen, the contexts around it, and the records the build leaves behind.

Showing a screen​

Contexts​

  • createContext(defaultValue) — pass a value down the tree without prop drilling
  • TranslationContext — how localized text resolves for a subtree; render() provides it at every root, so you rarely provide it yourself
  • ModalContext — marks that a subtree is inside a <Form>; read by the build's restriction pass

@bedrock-core/navigation owns routing, links, resident stacks and player history. @bedrock-core/ui/navigation is its UI facade. The optional @bedrock-core/navigation/core entry point provides createCoreNavigationAdapter(core) for the same route tree. The main UI entry point exposes rendering and controls independently of navigation.

Build records​

  • Compiled screens — the component-to-title registry, the snapshot a debug render is diffed against, and the reference table a static screen publishes

Errors​

  • Errors — every error class the library throws and the fix each one names

Types​

import type {
ControlProps, LayoutProps, FunctionComponent, JSX, RenderOptions,
PressEvent, SlotEvent, SubmitEvent, UiEvent, ContainerEvent,
CompiledSnapshot, RenderSession, RenderLifecycleEvent,
} from '@bedrock-core/ui';
import type {
DestinationOptions, DestinationKey, StaticScreenProps, StaticParamList,
} from '@bedrock-core/ui/navigation';

Every component's props type is exported beside it — ButtonProps, TextProps, ListProps, TabsProps and the rest — and every flex primitive through @bedrock-core/ui/flexbox.

Advanced​

Next steps​

  • Components — every built-in component
  • Hooks — state and effects
  • Hosts — what each screen can carry