Skip to main content

Styling

As CsTech, our main aim is accessibility for Cactus UI when we created the library. Therefore, each component comes with minimum styling that allows the component usable easily and as it's supposed to be. For a dev-friendly development experience, the styling of any Cactus UI component is kept simple and flexible as much as possible. You can style components the way using CSS, sass or styled-components etc.

We always will try to keep minimum default styling and as flexible as possible for all components.

Importing Built-in Style​

Some of Cactus UI components have built-in styling to display correctly and work properly. Styling should be imported like below:

import { <ComponentName> } from '@ciceksepeti/cui-<componentName>';
import '@ciceksepeti/cui-<componentName>/styles.css';

info

Every component page has examples about using the component and the examples show clearly which component needs its own built-in style importing.

Also, CSS bundle importing can be used to access all styling with one import.

import '@ciceksepeti/cui/styles.css';

Overriding & Adding New Styles​

You can style any component of Cactus UI like any other element in your app. Also, Cactus UI provides data attributes for each component and its subcomponent, to allow you can easily reach and style components.

Using Data Attributes​

Using Styled Component​

Inline CSS​

CSS Classname​