Subframe works with any framework that uses Typescript, React, and Tailwind CSS.
Set up Tailwind CSS
You can find more information on how to set up Tailwind CSS in the official Tailwind CSS documentation.
tailwind.config.js
file in your project root.
The file structure should now look like this:
tailwind.config.js
file to include the src
directory and any files we might use Tailwind CSS in.
tailwind.config.js
We’re assuming you’ll sync your Subframe projects to somewhere inside your
src/
directory. If not, you’ll need to adjust the content
array in your tailwind.config.js
file accordingly.src/styles.css
file:
src/styles.css
src/main.tsx
Install Subframe
We strongly recommend using
@subframe/cli
to initialize your project. If for some reason that’s not possible or you are troubleshooting issues, you can follow the steps below.Create a .subframe/sync.json
file
This file contains Subframe configuration settings that are used when syncing components.
.subframe/sync.json
https://app.subframe.com/<YOUR_PROJECT_ID>/playground
.
Install the necessary dependencies
Subframe depends on@subframe/core
. Run the following command to install the dependencies:
Include Subframe’s preset in your Tailwind CSS config
This will ensure that the theme you setup in Subframe applies to your app.tailwind.config.js
Sync your Subframe components
Run the following command to download your Subframe component code into your codebase:.subframe
directory and download the components accordingly.