We're sorry, but this feature is not yet available. We are working
hard to make it happen as soon as possible. Thank you for your
patience and understanding. Please check back later for updates.
Just a demo
The element you clicked is for demonstration purposes only and does
not lead to actual content. Everything you see here is a simulation
intended to demonstrate how the UI elements might look and behave in a
real application.
You can choose between using CSS variables or Tailwind CSS utility classes for theming.
Utility classes
CSS Variables
Convention
We use a simple background and foreground convention for colors. The background variable is used for the background color of the component and the foreground variable is used for the text color.
The background suffix is omitted when the variable is used for the background color of the component.
Given the following CSS variables:
The background color of the following component will be hsl(var(--primary)) and the foreground color will be hsl(var(--primary-foreground)).
CSS variables must be defined without color space function. See the Tailwind CSS documentation for more information.
List of variables
Here’s the list of variables available for customization:
For default backgrounds
For muted backgrounds
Background color for cards
Background color for popovers
For border color
Border color for inputs
For primary colors
For secondary colors
For accents such as hover effects
For destructive actions
For focus ring
Adding new colors
To add new colors, you need to add them to your CSS file and to your tailwind.config.js file.
You can now use the warning utility class in your components.
Using theme generators
v0.0.13 Franken UI supports theme generators. You can even create your own theme from scratch. To generate your own theme, follow these steps:
Note You can omit the --radius as it is not needed.
2. Convert the CSS to an object using this tool. It’s important to follow the correct format. Here’s an example of the CSS:
Once you have transformed that to an object, you should have something like this:
3. Finally, configure your tailwind.config.css to use your custom colors. You will do this inside the new palette option.
Or, if you are using the fine-grained configuration, you can save the palette to its own variable and apply it inside hooks() and variables() functions:
And that’s it. You can now customize colors and are not limited to the 12 predefined colors. You might ask why you can’t just paste it into your CSS file. Well, technically, you can. However, elements such as dividers, checkboxes, radios, etc., use SVG as their background, and it’s important to keep their colors in sync. Unfortunately, setting HSL inside inline SVG is not possible because they are not yet in the DOM. To fix this, HSL needs to be converted to HEX and injected into the SVG.
If you are confused, you can watch this short video on Mastodon on how to configure your own palette.