Learn how to install and integrate Franken UI in your projects.
Franken UI is an HTML-first UI component library built on UIkit 3 and extended with LitElement, inspired by shadcn/ui.
Perfect for beginners, the simplest installation can be done using CDN.
Optionally, you can include a pre-built (~91.45 kB gzipped) Tailwind CSS utility classes to complement with Franken UI. These
utility classes are pre-extracted from Tailwind CSS. If you find this too
large, you can always switch to a proper build process.
The following utility classes are available:
First, install the latest version of Franken UI using NPM:
Next, configure your vite.config.js file
to use the Franken UI plugin.
Once the plugin is configured, import the franken-ui.css file into your main CSS file:
Alternatively, you can pull Franken UI CSS directly from the node_modules directory.
Note Franken UI compiles CSS
behind the scenes, so make sure to import the Vite plugin at the top of your
vite.config.js file or second, right before
any other CSS plugins, to avoid issues when importing it into your CSS file.
If you'd like to use Tailwind CSS v4 alongside Franken UI, you can
manually configure your @theme directives
like so:
This will allow you to use utilities like bg-primary, bg-muted, and other custom utility
classes within your project. Make sure to update your vite.config.js as well.
Note If you choose to use
Franken UI alongside Tailwind CSS v4, make sure to set preflight to false
in your vite.config.js, as Tailwind
already includes this feature. You also need to set layer to true to make the class hirarchy equal.
Adding components inside layerExceptions
will disable CSS layering for those components, placing them at the highest
level of hierarchy.
Once you're done, you may now proceed adding JavaScript.