npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dax-ui/nextjs

v0.8.0

Published

dax-ui setup for Next.js App Router: UIProvider with server-rendered styles

Readme

@dax-ui/nextjs

dax-ui setup for Next.js App Router (Next 13 to 16). Next.js apps use this package's UIProvider instead of the one in @dax-ui/theme. On top of the theme, it:

  • collects component styles into <head> during server rendering, instead of a separate <style> tag beside every component;
  • applies the saved light/dark mode before the page paints, so it never flashes the wrong mode.

Everything MUI/Emotion needs for this is included; the app only needs Next.js and React.

Installation

pnpm add @dax-ui/nextjs

Then add the components you use, e.g. pnpm add @dax-ui/button @dax-ui/text-field.

Usage

Render UIProvider once, directly inside <body> of the root layout:

// app/layout.tsx
import { UIProvider } from '@dax-ui/nextjs';

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en" suppressHydrationWarning>
      <body>
        <UIProvider>{children}</UIProvider>
      </body>
    </html>
  );
}

suppressHydrationWarning on <html> is required: the color-mode script sets a class on it before React loads.

Components work in server and client components alike:

// app/page.tsx (a server component)
import { Button } from '@dax-ui/button';

export default function Page() {
  return <Button>Get started</Button>;
}

Custom theme

A theme object can't be passed from a server component (it contains functions), so build it in a small client file:

// app/providers.tsx
'use client';
import { UIProvider, createAppTheme } from '@dax-ui/nextjs';

const appTheme = createAppTheme({ shape: { borderRadius: 12 } });

export function Providers({ children }: { children: React.ReactNode }) {
  return <UIProvider theme={appTheme}>{children}</UIProvider>;
}

and render <Providers> in app/layout.tsx instead of <UIProvider>.

With Tailwind CSS or plain CSS

Set enableCssLayer so the app's own styles override MUI's without !important:

<UIProvider enableCssLayer>{children}</UIProvider>

Light/dark toggle (in a client component)

'use client';
import { useColorScheme } from '@dax-ui/nextjs';

export function ModeToggle() {
  const { mode, setMode } = useColorScheme();
  return <button onClick={() => setMode(mode === 'dark' ? 'light' : 'dark')}>Toggle mode</button>;
}

Exports

| Export | What it is | | --- | --- | | UIProvider | The Next.js App Router provider; props below | | useColorScheme, createAppTheme, styled, useTheme, Typography, theme, themeOptions, Theme, ThemeOptions | Re-exported from @dax-ui/theme, so Next.js apps don't need to install it separately |

Pages Router isn't supported yet.

Props

| Prop | Type | Default | Description | | --- | --- | --- | --- | | children (required) | ReactNode | | The app. Every @dax-ui component must render inside the provider. | | defaultMode | "light" \| "dark" \| "system" | system | Color mode on first visit. system follows the OS setting. After that, the user's choice made through useColorScheme().setMode() is remembered. | | disableCssBaseline | boolean | false | Skips MUI's CSS reset (CssBaseline), for apps that already ship their own. | | enableCssLayer | boolean | false | Wraps MUI's generated styles in @layer mui, so the app's own CSS or Tailwind utilities override them without !important. | | theme | Theme | theme | Replaces the default theme, e.g. createAppTheme({ ...overrides }). |