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.
npm i @riskchallenger/open-components
@import "@riskchallenger/open-components/main.css";
@import "npm:@riskchallenger/open-components/main.css";
@import "/node_modules/@riskchallenger/open-components/main.css";
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.
If you want a straight corner look, simply set the default border radius to 0. Check the example below
If you want to change the font-size, simply do so as in the below 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; }
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
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
Open Components uses Material Icons. For a full list of avaiable icons see: https://fonts.google.com/icons?icon.set=Material+Icons
With icons
Simple modal with only a body
Body and footer
Modal without a header; only body and footer
Header, body and footer
Full modal with header, body and footer
With close button
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.
Hover over me
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
With action