You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Start by installing the components library in your project:
8
10
9
11
```
10
12
npm install @code4rena/components-library
11
13
```
12
14
13
-
Next, to ensure that all the components have the appropriate styling, import the library's css file in your application's wrapping Layout or in any page/component wrapping your application where you would normally import global styling.
15
+
### 2. Component Styling
16
+
Next, to ensure that all the components have the appropriate styling, **import the library's styles** into your application. This can be done in one of two ways:
17
+
18
+
1. If you have a global CSS/SCSS file, you can import the custom styles using the CSS import rule into that global file.
19
+
```
20
+
@import "@code4rena/components-library/styles"
21
+
```
22
+
2. Another option is to import it in any layout/page/component which wraps your entire web application; in doing so, you make sure the styling bubbles down to all pages of the application using the library's components.
All the components in this package can be accessed through named imports. For a full list of available components, take a look at our [Storybook](https://components-library-wine.vercel.app)
19
29
20
30
```
@@ -23,6 +33,19 @@ import { Alert } from "@code4rena/components-library";
23
33
<Alert {...args} />
24
34
```
25
35
36
+
### 4. Typescript Support
37
+
All components in this library have TypeScript support. Types for all complex component props are also named exports available through the `/types` subdirectory (see example below):
38
+
```
39
+
import { ButtonSize, ButtonType, ButtonVariant } from "@code4rena/componenets-library/types";
40
+
41
+
<Button
42
+
label="Sample Button"
43
+
type={ButtonType.BUTTON}
44
+
variant={ButtonVariant.SECONDARY}
45
+
size={ButtonSize.NARROW}
46
+
/>
47
+
```
48
+
26
49
## Run Storybook
27
50
Storybook will run on [http://localhost:6006](http://localhost:6006)
Start by installing the components library in your project:
8
10
9
11
```
10
12
npm install @code4rena/components-library
11
13
```
12
14
13
-
Next, to ensure that all the components have the appropriate styling, import the library's css file in your application's wrapping Layout or in any page/component wrapping your application where you would normally import global styling.
15
+
### 2. Component Styling
16
+
Next, to ensure that all the components have the appropriate styling, **import the library's styles** into your application. This can be done in one of two ways:
17
+
18
+
1. If you have a global CSS/SCSS file, you can import the custom styles using the CSS import rule into that global file.
19
+
```
20
+
@import "@code4rena/components-library/styles"
21
+
```
22
+
2. Another option is to import it in any layout/page/component which wraps your entire web application; in doing so, you make sure the styling bubbles down to all pages of the application using the library's components.
All the components in this package can be accessed through named imports. For a full list of available components, take a look at our [Storybook](https://components-library-wine.vercel.app)
19
29
20
30
```
21
31
import { Alert } from "@code4rena/components-library";
22
32
23
33
<Alert {...args} />
24
34
```
35
+
36
+
### 4. Typescript Support
37
+
All components in this library have TypeScript support. Types for all complex component props are also named exports available through the `/types` subdirectory (see example below):
38
+
```
39
+
import { ButtonSize, ButtonType, ButtonVariant } from "@code4rena/componenets-library/types";
0 commit comments