flemo

API Reference

Every export from `@flemo/react`, with the page that explains it

Components

ExportSummaryPackageMore
RouterRoot container. Renders the active screen.@flemo/reactRouter
RouteMaps a path (or paths) to an element.@flemo/reactRouter
ScreenPer-route screen container with app/nav/safe-area slots.@flemo/reactScreen
LayoutScreenScreen variant for shared layoutId morphs across screens.@flemo/react-layoutLayoutScreen
LayoutConfigWraps motion children with the current screen's transition timing.@flemo/react-layoutLayoutScreen

Hooks

ExportReturnsMore
useNavigate(){ push, replace, pop }Navigation
useParams<T>()The current route's params (path + query merged)Navigation
useStep<T>(){ pushStep, replaceStep, popStep } for sub-statesNavigation
useScreen()Current screen meta (id, isActive, zIndex, …)
useViewportScrollHeight()Visual-viewport scroll metrics, useful for mobile keyboards

Transition factories

ExportWhen to use
createTransitionSix-phase transitions (idle / enter / exit / enterBack / exitBack)
createRawTransitionFull control over every navigate state
createDecoratorSix-phase decorator (e.g., overlays between screens)
createRawDecoratorDecorator with full per-state control

See Transitions for examples.

Built-in transition names

"cupertino" · "material" · "layout" · "none"

Built-in decorator names

"overlay"

Type registries

InterfacePurpose
RegisterRouteRegister your routes for type-safe navigate.push and useParams
RegisterTransitionRegister custom transition names
RegisterDecoratorRegister custom decorator names
declare module "@flemo/react" {
  interface RegisterRoute {
    /* … */
  }
  interface RegisterTransition {
    /* … */
  }
  interface RegisterDecorator {
    /* … */
  }
}

Type exports

ScreenProps · TransitionName · RegisterTransition · DecoratorName · RegisterDecorator

Peer dependencies

@flemo/react requires only react ^19 and react-dom ^19. @flemo/react-layout adds motion ^12 as a peer dependency — install it when you use <LayoutScreen> or <LayoutConfig>.

On this page