Prepare your local environment. Subframe generates React code written in Typescript and styled with Tailwind CSS. We work with any framework that uses React and Typescript.
tsconfig.json
file for your components. This will allow you to import Subframe components in your code using the shorthand: import { Button } from "@/ui/components/Button"
1{
2 "compilerOptions": {
3 "paths": {
4 "@/ui/*": ["./src/ui/*"]
5 }
6 }
7}
8
tailwind.config.js
file to ensure your Subframe theme applies to your project and update your content paths to ensure Tailwind runs on your Subframe components.1module.exports = {
2
3 // Extend the Subframe presets
4 presets: [require("./src/ui/tailwind.config.js")],
5
6 content: [
7 "./src/ui/**/*.{js,ts,jsx,tsx}",
8 // ...rest of your content source paths
9 ],
10}
<head>
tag in your root page (e.g. index.html
):1<head>
2 <link rel="preconnect" href="https://fonts.googleapis.com"/>
3 <link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous"/>
4 <link href="https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap" rel="stylesheet"/>
5</head>