Installation

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.

Setup
1
Initialize your Subframe project
This one-time installation will setup your project settings and theme in your code base.
2
Configure tsconfig.json aliases
Add an alias to your tsconfig.json file for your Subframe folder. This will allow you to import Subframe components in your code using the shorthand: import {Button} from "@/subframe/components/Button"
1{
2  "compilerOptions": {
3    "paths": {
4      "@/subframe/*": ["./src/subframe/*"]
5    }
6  }
7}
8
3
Setup Tailwind config
Add the Subframe preset to your 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  presets: [require("./src/subframe/tailwind.config.js")],
3
4  content: [
5    "./src/subframe/**/*.{js,ts,jsx,tsx}",
6    // ...rest of your content source paths
7  ],
8}
9
4
Load fonts
Fonts are set by your theme and will be used in your Subframe components and pages. Add the following to your <head> tag in your root page (e.g. index.html):
Changing the fonts in your theme will require updating these links.
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>
5
Start building
Complete our or and start exporting your designs to code!