@hamur/fumadocs
The Fumadocs framework provider for Hamur React. It is a package, not a module: it adds nothing to modules. Fumadocs reads the path, the params, the router and the link component of your framework through its FrameworkProvider; this package fills them from @hamur/adapter-react. fumadocs-core and @hamur/adapter-react are its peers. The Docs with Fumadocs recipe builds a site with it.
bun add @hamur/fumadocs fumadocs-core fumadocs-ui
// app/app.tsx
import { Outlet } from "@hamur/adapter-react"
import { HamurProvider } from "@hamur/fumadocs"
import { RootProvider } from "fumadocs-ui/provider/base"
export default function App() {
return (
<HamurProvider>
<RootProvider>
<Outlet />
</RootProvider>
</HamurProvider>
)
}
HamurProvider
HamurProvider(props: HamurProviderProps) wraps its children in Fumadocs' FrameworkProvider with these parts:
| Fumadocs hook or component | Hamur |
|---|---|
usePathname() | useRoute().path |
useParams() | useRoute().params |
useRouter() | useRouter(): its push(url) and refresh() |
Link | Link of @hamur/adapter-react, given href: a plain <a> the navigator handles |
Image | none: Fumadocs falls back to a plain <img>; pass Image for your own component |
Place it above Fumadocs' RootProvider, inside the app root, so it can read the route. Without it, a Fumadocs component fails with You need to wrap your application inside \FrameworkProvider`.`
HamurProviderProps
| Prop | Type | Default |
|---|---|---|
children | ReactNode | required |
Link | Framework["Link"] | the Link of the adapter |
Image | Framework["Image"] | unset: a plain <img> |
Framework is the type of fumadocs-core/framework; the package copies none of it. A Link or Image you pass replaces the default.