Skip to content

Commit

Permalink
docs: update next-themes & remix-themes example
Browse files Browse the repository at this point in the history
  • Loading branch information
pheralb committed Jul 24, 2024
1 parent ccbcb01 commit f6279a0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions website/app/routes/dark-mode.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,18 @@ This page shows examples of how to use [`next-themes` (Next.js)](https://github.

'use client';

import { ToastProvider, type ToastProviderProperties } from '@pheralb/toast';
import {
ToastProvider,
type ToastTheme,
type ToastProviderProperties,
} from '@pheralb/toast';

import { useTheme } from 'next-themes';

const ToastClientProvider = (props: ToastProviderProperties) => {
const { theme } = useTheme();
return (
<ToastProvider theme={theme === 'dark' ? 'dark' : 'light'} {...props}>
<ToastProvider toastFont="font-sans" theme={theme as ToastTheme} {...props}>
{props.children}
</ToastProvider>
);
Expand Down Expand Up @@ -80,12 +85,14 @@ Import the `useTheme` hook from `remix-themes` and change the theme value:
```tsx
// 📄 app/root.tsx

import clsx from 'clsx';
import { ToastProvider } from '@pheralb/toast';
import { useTheme } from 'remix-themes';

function App() {
const [theme] = useTheme();
return (
<html lang="en" className={cn(theme)}>
<html lang="en" className={clsx(theme)}>
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
Expand Down

0 comments on commit f6279a0

Please sign in to comment.