Bun LogoReact Logo

Bun React Framework

Next.js features. Bun speed.

A full-stack React framework built on Bun. Get SSR, static generation, ISR, client-side navigation, and typesafe APIsβ€”all.

Feature Demos

Explore each feature with interactive examples. Click any card to see it in action.

Framework Features

Next.js App Router patterns with Bun performance. See what's supported and what's coming.

πŸ“File-Based Routing
page.tsx / index.tsxβœ“
layout.tsx (nested)βœ“
not-found.tsxβœ“
[param] dynamic routesβœ“
[...path] catch-allβœ“
loading.tsxβœ—
🎨Rendering Strategies
Server-Side Renderingβœ“
Static Generation (SSG)βœ“
Incremental Static Regen (ISR)βœ“
Suspense Streamingβœ“
Client-Side Navigationβœ“
Partial Prerendering (PPR)βœ—
βš›οΈComponents & Data
Server Components (default)βœ“
Client Componentsβœ“
loader() data fetchingβœ“
generateParams()βœ“
Async Componentsβœ“
Cache Componentsβœ—
πŸ”§API & Infrastructure
Typesafe API Routesβœ“
Zod Validationβœ“
Middlewareβœ“
On-Demand Revalidationβœ“
HMR Developmentβœ“
Tailwind CSSβœ“

Simple API

Clean, intuitive APIs that feel familiar. Built for developer experience.

Static Pages
definePage({
  type: 'static',
  loader: async () => ({
    data: await fetchData()
  }),
  component: ({ data }) => (
    <div>{data.title}</div>
  )
})
Client Components
// Using clientComponent() wrapper:
export const Counter = 
  clientComponent(() => {
    const [count, setCount] = 0
    return (
      <button onClick={() => 
        setCount(c => c + 1)}>
        {count}
      </button>
    )
  })

// Or using "use client" at top of file:
"use client";
export const Counter = () => { ... }
Client Navigation
defineLayout({
  clientNavigation: true,
  component: ({ children }) => (
    <nav>...</nav>
    {children}
  )
})
Incremental Static Regeneration
definePage({
  type: 'static',
  revalidate: 3600, // Revalidate every hour
  loader: async () => ({
    products: await fetchProducts()
  }),
  component: ({ data }) => (
    <div>{data.products.map(...)}</div>
  )
})
Typesafe API Routes
// Define route
import { route } from "~/framework/shared/api";
import { z } from "zod";

export const byId = route({
  method: "GET",
  params: z.object({ id: z.string() }),
  response: z.object({ id: z.string(), name: z.string() }),
  handler: ({ params }) => getUser(params.id),
});

// Compose API
import { createAPI } from "~/framework/shared/api";
export const api = createAPI({
  users: { byId, create }
});
Middleware
import { defineMiddleware } from "~/framework/shared/middleware";

export default defineMiddleware({
  exclude: ["/favicon.ico", "/*.svg"],
  handler: async (request, next) => {
    console.log(`${request.method} ${request.url}`);
    const response = await next();
    // Modify response headers, etc.
    return response;
  },
});