Dashboard UI Kit

Apps PreviewDownload Design Package

CSS and Theming

Dashboard UI kit is developed in a friendly way towards CSS adjustments and theming. The core core componnets are styled with SCSS, which gives us the best control over the class naming. The components are developed with Bootstrap in mind - this doesn't mean that you need bootstrap to run the application, but if you are used to bootstrap, you can freerly use it (however it's not recommended to use the JS part of the Bootstrap). Here is how the DOM output look like.

// react
<Button primary>Default</Button>

// DOM
<button class="btn btn-primary" type="button" role="button">

Zero dependencies and no hassle integration

You don't need any stylesheet libraries, initialization is unnecessary and overriding styles is dead simple. To install the library, simple follow this guide. TLDR, install our kit, import styles and you are good to go!

Overriding styles

As seen in the code above, the class naming is very straightforward and easy to work with. Many components share the same class naming as Bootstrap, but we have many custom components too.

The important fact is that during the development, we tried to reduce the CSS specificity to minimum. We worked with many libraries and sometimes it is really pain to style elements which look something like this:

.select .select-container.select-container__open .select-item.select-item__selected .icon

We hate it, you hate it and it's just a pain to style it. And because of that, we tried to reduce the specificity to maximum of 2. There might be some exception, but otherwise, we tried our best to deliver the best developing experience.

Theming with CSS Variables

This has been a big topic. We want to deliver an amazing experience for developers and this is no exception. We decided to leverage CSS Variables instead of complicated injects, stylesheets and other dependencies that require a lot of initialization.

Using CSS variables however comes with a cost. If you intent to support all browsers, it might be problematics, you can check the browser support here. Browser support can be resolved by adding css-var-ponyfill.

Creating custom theme

This cannot be easier. On the right part of the top bar, you can switch between light and dark theme. By default, light theme is enabled. We created a dark theme for you as well, this is how the code looks like:

body {
  --bg-main: #252529;
  --bg-base: #2c2c31;
  --border-color-base: #34343a;
  --border-color-main: #44444e;
  --border-color-highlight: #64646e;
  --text-base: #ccc;
  --text-main: #ddd;

With few lines of code, we changed the core appearence of the documentation, amazing isn't it? You can add this code into your CSS file or add it somewhere in the JSX with inline styles.

  body {
    --bg-main: #252529;

You can also override variables localy, for example navigation panel only.

.my-nav-panel {
  --bg-main: #252529;

Using CSS variables in your (S)CSS

You can use your css variables like so

.my-class {
  color: var(--color-primary);

Or you can import or Sass vars file (recommended) to make sure that your conde is consistent, which will output the code above.

@import '@duik/core/_vars.scss';
.my-class {
  color: $color-primary;

List of CSS variables

Default ValueColorsSass VariableDescription
--green$color-greenGreen color
--blue$color-blueBlue color
--indigo$color-indigoIndigo color
--yellow$color-yellowYellow color
--orange$color-orangeOrange color
--red$color-redRed color
Default ValueColors by domainSass VariableDescription
--primary$color-primaryPrimary (theme) color
--success$color-successFor displaying positive output or actions
--warning$color-warningFor displaying negative output or actions
--danger$color-dangerDisplaying actions with an impact
--info$color-infoInformative color
Default ValueBackgroundsSass VariableDescription
--bg-base$bg-baseBase background color for your content.
--bg-main$bg-mainMain background color for your content, which adds higher contrast.
--bg-adverse-main$bg-adverse-mainAdverse color for the main background (e.g. white vs black)
Default ValueText ColorsSass VariableDescription
--text-main$text-mainMain content color for the highest contrast, e.g. headlines.
--text-base$text-baseBase text color, recommended for paragraphs.
--text-secondary$text-secondarySecondary text color with less contrast, e.g. for less important typographic descriptions.
--text-tertiary$text-tertiaryTertiary text color, e.g. for labels
--text-on-color$text-on-colorColor of a text that is used on the colored background.
--text-adverse-main$text-adverse-mainSame as text-main but adverse
--text-adverse-base$text-adverse-baseSame as text-base but adverse
Default ValueBordersSass VariableDescription
--border-color-base$border-color-baseBase border color with regular contrast, e.g. text inputs
--border-color-main$border-color-mainBorder color with higher contrast, e.g. for hover state
--border-color-highlight$border-color-highlightBorder color with highest contrast