Pick your brand color

About

Open Components is a library of components styled with pure CSS. It heavily relies on Open Props. The design and implementation of the components was done by RiskChallenger.

Installation
Getting started
Usage

Installation

  1. npm i @riskchallenger/open-components
  2. Import main.css in your application, here are some options depending on your bundler
    1. @import "@riskchallenger/open-components/main.css";
    2. @import "npm:@riskchallenger/open-components/main.css";
    3. @import "/node_modules/@riskchallenger/open-components/main.css";
  3. That's it 😄

Getting started

Brand color

All you need to do is set a brand color. Hover over the options above to get the color name. Check out the Usage-tab to have a preview of the components in your brands color. These options are from the color-scheme on Open Props. However, feel free to use any other color you like.

Border radius

If you want a straight corner look, simply set the default border radius to 0. Check the example below

Font size

If you want to change the font-size, simply do so as in the below examples.

Examples

These are the default values in Open Components.

html {
  --brand: var(--cyan-6);
  --default-radius: var(--radius-2);
  --default-font-size: 16px;
}

Here's an example for a pink theme with straight corners and smaller text.

html {
  --brand: var(--pink-6);
  --default-radius: 0;
  --default-font-size: 12px;
}

Buttons

Type
Example
Source code
Regular / primary Outline / secondary Discrete Disabled Icon left Icon right Icon only Icon only, discrete Form button
Button group
Cool usecase
Danger outline button Warning outline button

Inputs

Type
Example
Source code
Text Search Email Password Textarea File input Select Range Autocomplete
<input type="text" list="items" />
<datalist id="items">
  <option>Lorem ipsum</option>
  <option>dolor sit</option>
  <option>amet</option>
</datalist>
  
Date Disabled Invalid Checkbox Radio

Icons

Open Components uses Material Icons. For a full list of avaiable icons see: https://fonts.google.com/icons?icon.set=Material+Icons

Type
Example
Source code
Icon mood

Tabs

Type
Example
Source code
Tabs only
General
Account
Disabled
With icons
General settings
Account person
Disabled do_not_disturb_on

Modals

Type
Example
Source code
Body only Body and footer Header, body and footer With close button

Tooltips

Warning: when you set the `data-tooltip` property on an element, it will get `position: relative`. This might cause unexpected behaviour but can easily be overriden of course.

Type
Example
Source code
Simple tooltip

Hover over me

Toasts

Also known as a snackbar or simply notification. Toasts should only contain non-crucial information and should always dissapear automatically, with or without an action. TODO make them stack

Type
Example
Source code
Text only With action