CSS-in-JS refers to a collection of ideas for solving complex problems with CSS. It is NOT a particular library, although many might solve a divergent subset of problems and use different approaches, depending on their implementation details.
However, what all implementations have in common, is that they tackle problems using APIs instead of convention and leverage JavaScript as a language for authoring styles.
It also solves problems such as lack of modules, lack of scoping, implicit dependencies and dead code.
Some of the configurable options are listed below.
The Checkbox component can be used in 2 styles, as shown below:
React version of Bootstrap v4 grid system.
One of the most used components to condense a height of a lengthy page. With the configurable option of scrolling to opened
A vertically stacked list of headers which can be clicked to show or hide associated HTML content. It is one of many ways you can expose content to users in a progressive manner.
To provide a good user experience, the HTML content inside an accordion should be limited to text based items such as paragraphs, lists and tables.
The visual design includes features intended to help users understand that the accordion provides enhanced keyboard navigation functions. When an accordion header button has keyboard focus, the styling of the accordion container and all its header buttons is changed.
When any accordion header button receives focus:
This accordion has key board support for the following:
| Key(s) | Function |
|---|---|
| Space or Enter | When focus is on the accordion header of a collapsed section, expands the section. |
| Tab |
|
| Shift + Tab |
|
| Down Arrow |
|
| Up Arrow |
|
Full list props listed below:
| Prop | Type | Default | Description |
|---|---|---|---|
| canScrollToOpened | Boolean | false | Scroll page to expanded item |
| colour | String | blue | Active accent colour which can be one of blue, green or purple |
| items | Array | [] | Array of Objects with shape:
|
Fun with dynamically created refs
This was one of those components I came across on a few sites and just had to build, for fun!
The component accepts 2 props:
Showcasing different variations and configurations.
Display a short and important message.
The demo below previews the tab component, its variations, and configuration options.
Tabs organize and allow navigation between groups of content that are related and at the same level of hierarchy.
Each tab should contain content that is distinct from other tabs in the same set. For example, tabs can present different sections of news, different genres of music, or different themes of documents.
Do's: