New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@code4rena/components-library

Package Overview
Dependencies
Maintainers
7
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@code4rena/components-library

Code4rena's official components library

4.4.0
npm
Version published
Weekly downloads
138
294.29%
Maintainers
7
Weekly downloads
 
Created
Source

Jest

Code4rena Components Library

Using Components in your project

1. Installing the library

Start by installing the components library in your project:

npm install @code4rena/components-library

2. Component Styling

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:

  • If you have a global CSS/SCSS file, you can import the custom styles using the CSS import rule into that global file.
@import "@code4rena/components-library/styles"
  • 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.
import "@code4rena/components-library/styles";

3. Importing 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

import { Alert } from "@code4rena/components-library";

<Alert {...args} />

4. Typescript Support

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):

import { ButtonSize, ButtonType, ButtonVariant } from "@code4rena/components-library/types";

<Button
    label="Sample Button"
    type={ButtonType.BUTTON}
    variant={ButtonVariant.SECONDARY}
    size={ButtonSize.NARROW}
/>

Keywords

Code4rena

FAQs

Package last updated on 12 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts