check
Code copied to clipboard.
close
menu

Install

Pre-Requisite Knowledge

This documentation assumes the following:

  • You already have Node.js, npm, and Git installed on your local machine
  • You're familiar with basic terminal commands like cd

Summary

LiftKit consists of config files and actual components. The config files are just utility files needed in order to connect to the component registry so you can install components from the command line.

1. Create the Config Files

Option 1. Clone Template Project

  • Paste the following command into your terminal to clone the template.
git clone https://github.com/Chainlift/liftkit-template.git
  • cd into the newly-created project.
    • If you get an error that says direnv: error, just ignore it. It's a bug we'll have fixed soon.
  • Run npm install to install dependencies.
  • Install the components you need. See below.
  • Once you've installed your components, make sure to import LiftKit's index.css to your app's globals.css.

What's in the template?

The template is just a blank Next.js project with LiftKit Core's config files pre-installed. It's the fastest way to get up and running with a new project running LiftKit.

Option 2: Add to Existing Next.js Project

  • cd into your project's root directory from the command line.
  • Install LiftKit CLI as a dev dependency
npm install @chainlift/liftkit --save-dev
  • Initialize LiftKit
npx liftkit init
  • If prompted to add an "add" script to package.json, say yes
  • If prompted to install shadcn as a devDependency, say yes
  • Install the components you need. See below.
  • Once you've installed your components, make sure to import LiftKit's index.css to your app's globals.css.
@import url('@/lib/css/index.css')

What does npx liftkit init actually do?

Running this command adds two files to the root of your project:

  • components.json
  • tailwind.config.ts*

*You do not need tailwind itself to use LiftKit. Just this file, for now. See FAQ below.

Install LiftKit Components & Styles

LiftKit Core is just the base configuration files you need in order for it to work.

LiftKit Components are actual UI components. When you install components, it installs the minimum required CSS for it to work.

If warned that you're using React 19, select Use --force and proceed.

Method Instructions
Everything
All components, CSS, and types
npm run add all
One Component
Specified component only, all CSS and types
npm run add component-name-kebab-case
Base
CSS and types only
npm run add base

FAQ

  • I only installed one component, but it installed multiple. Why?
    • You likely installed a component that imports other components. For example, if you install the Badge component, it will also install the Icon component, because Badge imports the Icon component in its source code.
  • Why did it install CSS for components I'm not using?
    • This is by design. It ensures developers can customize and play around freely. At build time, unused styles are removed automatically.
  • How can I get rid of unused CSS?
    • Unused CSS is automatically removed at build time.
  • Does LiftKit require Tailwind to work? / Why is it adding a tailwind.config file?
    • No. It literally just needs a file called tailwind.config.ts. If you check your package.json, tailwind is not a dependency. This is a requirement of the shadcn component registry we're using for delivery at the moment, and it will be removed when we no longer use it.

The Figma template is currently a dumpster fire.

It works, but it's not pretty or easy to use. We are actively working on improving it. You can help us move faster by becoming a contributor. Learn more.

Clone the Community File

Known Issues

Button variants are out of control

  • We know. We are not proud of that, and it will be fixed soon.
    • The reason it's like that is that LiftKit buttons adjust padding based on icon presence, and padding values are not controllable via props.
    • Therefore, the only option—it seemed at the time—was to explicitly list everything out.
    • We have since realized this was an unspeakably bad idea.

Local variables are not self-explanatory and need documentation

  • Figma doesn't support margins or em units
  • Therefore, we had no choice but to manually convert everything to pixels assuming 1rem = 16px.
  • But for now, here's the gist of it
    • Variables are organized into collections
    • The global collection equates to base LkSizeUnit variables.
    • There's also a collection called Text Spacing Vals
      • Within Text Spacing Vals, there are subsets for each LkFontClass
      • Those subset values equate to adding that size relative to that LkFontClass' box-height.
      • In other words, to simulate adding .m-bottom-xs to a display2 element, you would apply the spacing with variable display2/xs.

LiftKit for Webflow Might Get Deprecated

We've recently found that the bulk of LiftKit's early adopters are not using it for Webflow. Since LiftKit is maintained entirely by 2 people who already have other full-time jobs, we may have to put LiftKit for Webflow on pause. If you disagree and would like us to continue supporting it, please send us a message.

arrow_forward
Contact Us

Clone the Template