CSS Components logo

Installation

How to install CSS Components and get up and running.

Install CSS Components

Install CSS Components from your terminal via npm or yarn.

1# With npm
2npm install @phantomstudios/css-components
3
4# With yarn
5yarn add @phantomstudios/css-components
6

Import it

Import styled from @phantomstudios/css-components.

1import { styled } from "@phantomstudios/css-components";
2

Use it

Use the styled function to create a component and add styles to it.

1import { styled } from "@phantomstudios/css-components";
2
3const Button = styled("button", {
4  css: "root",
5});
6

Render it

Finally, render the component.

1import { styled } from '@phantomstudios/css-components';
2
3const Button = styled('button', {...});
4
5() => <Button>Button</Button>;
6