Memphi UI ❤️ Next.js. Get started in minutes with our step-by-step installation guide.
Run the init command to create a new Next.js project or to setup an existing one:
npx create-next-app@latest my-memphi-app --typescript --tailwind --eslint --app
This creates a new Next.js project with TypeScript and Tailwind CSS configured.
Install the required dependencies for Memphi UI components:
npm install @radix-ui/react-slot class-variance-authority clsx tailwind-merge
What these packages do:
• @radix-ui/react-slot
- Accessible component composition
• class-variance-authority
- Type-safe component variants
• clsx
- Conditional class names
• tailwind-merge
- Merge Tailwind classes safely
Create the utility function for merging classes. Add this to lib/utils.ts
:
import { type ClassValue, clsx } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
Add Memphi UI colors to your Tailwind configuration. Update your globals.css
:
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
--font-sans: var(--font-comic-neue);
--color-sidebar-ring: var(--sidebar-ring);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-accent: var(--sidebar-accent);
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
// ... (click expand to see more)
We use Comic Neue for that playful Memphis feel. Add it to your layout:
import { Comic_Neue } from 'next/font/google'
import './globals.css'
const comicNeue = Comic_Neue({
variable: '--font-comic-neue',
subsets: ['latin'],
weight: ['300', '400', '700'],
})
export default function RootLayout({
children,
}: {
// ... (click expand to see more)
Then update your Tailwind config to use the font:
fontFamily: {
sans: ['var(--font-comic-neue)', 'Comic Neue', 'cursive'],
}
Now you can start using Memphi UI components in your project. You can install them manually by copying the code.
Install components directly via the shadcn CLI for even faster setup.
import { Button } from "@/components/memphi/button"
export default function MyPage() {
return (
<div className="p-8">
<Button>Hello Memphi UI!</Button>
<Button variant="outline" shadowColor="oklch(0.6 0.2 240)">
Custom Shadow
</Button>
</div>
)
}