Skip to content

Framework Adapters

ufbr is designed to be completely framework-agnostic. All adapters share the exact same createFileBasedRouter API contract, differing only in the subpath module you import and your framework’s typical file extensions.

Select your UI framework below to see its entry point initialization:

src/main.js
import { createFileBasedRouter } from 'ufbr/ziko'
createFileBasedRouter({
pages: import.meta.glob('./pages/**/*.js'),
target: document.body
})

Regardless of which adapter you use, createFileBasedRouter takes the exact same configuration object:

Parameter Type Required Description
pages Record<string, () => Promise<any>> Yes Result of Vite’s import.meta.glob() utility.
target HTMLElement Yes The DOM element where page components will render.