@cryptomystery/ui
v0.1.0
Published
Shared UI components for Cryptomystery built with Tailwind CSS and Radix UI.
Downloads
27
Readme
@cryptomystery/ui
Shared UI components for Cryptomystery built with Tailwind CSS and Radix UI.
Installation
npm install @cryptomystery/uiUsage
- Add the following to your
tailwind.config.js:
const { fontFamily } = require("tailwindcss/defaultTheme")
/** @type {import('tailwindcss').Config} */
module.exports = {
darkMode: ["class"],
content: ["./node_modules/@cryptomystery/ui/**/*.{js,ts,jsx,tsx}"],
theme: {
extend: {
// Copy the theme configuration from the UI package
}
},
plugins: [require("tailwindcss-animate")],
}- Import styles:
import "@cryptomystery/ui/styles.css"- Import components and utilities:
// Components (import from components/)
import { Button } from "@cryptomystery/ui/components/button"
import { Card } from "@cryptomystery/ui/components/card"
// Hooks (import from hooks/)
import { useTheme } from "@cryptomystery/ui/hooks/use-theme"
// Utils (import from utils)
import { cn } from "@cryptomystery/ui/utils"- For theming, use the appropriate provider:
For Next.js:
import { ThemeProvider } from "@cryptomystery/ui/components/theme-provider-next"
export default function RootLayout({ children }) {
return <ThemeProvider>{children}</ThemeProvider>
}For React:
import { ThemeProvider } from "@cryptomystery/ui/components/theme-provider-react"
export default function App({ children }) {
return <ThemeProvider>{children}</ThemeProvider>
}