Index
Setup
Get started with RetroUI in just a few simple steps.
Initialize
Start by creating a new project. The setup requires a NextJS/ ReactJS app with Typescript & Tailwind.
For NextJS:
npx create-next-app@latest my-app --typescript --tailwindcss
For ReactJS:
npx create-react-app my-app --template typescript
To add tailwind, you can follow these docs.
Installation
Install RetroUI using npm:
npm i pixel-retroui@latest
RetroUI v2.0.0 gives you the option to use the default Minecraft font or your own fonts. You can select your preference during setup.
Configuration
Choose one of the following setup methods:
CLI Setup (Recommended)
Run the CLI setup tool to configure RetroUI for your project:
npx pixel-retroui
The CLI will guide you through selecting font options and create the necessary setup files for your project.
After setup, import the generated file in your Next.js layout file:
import '@/lib/pixel-retroui-setup.js';
Or
Manual Setup
Add the following import to your main CSS file:
globals.css in Next.js or index.css in React
@import 'pixel-retroui/dist/index.css';
In manual setup,
If you want to use the default Minecraft font, add this to your CSS too:
@import 'pixel-retroui/dist/fonts.css';
Basic Usage
Now you can use the components in your React application:
import React from 'react';import { Button, Card } from 'pixel-retroui';function App() {return (<div><h1 className="text-2xl font-minecraft mb-4">Welcome to My Retro App</h1><Card className="p-4 mb-4"><h2>This is a pixel-styled card</h2><p>You can put anything inside!</p></Card><Button>Click me!</Button></div>);}export default App;
Customization
RetroUI components can be customized using props and TailwindCSS classes. Here's an example of customizing a button:
<Buttonbg="#c381b5"textColor="#fefcd0"shadow="#fefcd0"className="px-6 py-2">Custom Button</Button>
Troubleshooting
Next Steps
- Explore our Components to see what's available
- Visit our GitHub repository for the latest updates and to report issues
Need more help? Feel free to open an issue on GitHub or drop a dm on Twitter.