Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@0xsquid/ui

Package Overview
Dependencies
Maintainers
3
Versions
177
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@0xsquid/ui

Squid's UI components

  • 0.13.11
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.3K
increased by189.16%
Maintainers
3
Weekly downloads
 
Created
Source

Squid UI

React components library for Squid V2

Package installation and usage

Install the package:

yarn add @0xsquid/ui

Import styles in your entry point:

// src/main.tsx | src/pages/_app.tsx | etc...
import '@0xsquid/ui/dist/index.css'

Wrap your app with our theme provider <SquidConfigProvider /> and specify your theme:

import { SquidConfigProvider, Button } from '@0xsquid/ui'

function App() {
  return (
    <SquidConfigProvider theme={yourTheme}>
      <Button label="Hello world" variant="primary" size="md" />
    </SquidConfigProvider>
  )
}

Development

Install dependencies

yarn install

Start Storybook dev server

yarn storybook

Build package

To build the package using Rollup, run:

yarn build

This command will:

  1. compile Tailwind CSS classes into src/styles/compiled-tailwind.css
  2. bundle source code, along with its type declarations, into the dist/ folder
  3. copy src/styles/compiled-tailwind.css to dist/index.css

Lint and format

To format and lint the code, run:

yarn format:fix
yarn lint:fix

Folder structure

- src
  - index.ts <- barrel file
  - components
    - index.ts <- barrel file
    - buttons
      - index.ts <- barrel file
      - Button.tsx
    - lists
      - index.ts <- barrel file
      - HistoryItem.tsx
  - stories
    - buttons
      - Button.stories.tsx
    - lists
      - HistoryItem.stories.tsx

When creating a new component, don't forget to update the barrel file, exporting your component in the index.ts file in the corresponding component folder. You can also install the AutoBarrel VSCode extension.

Images

In case you need to add images somewhere that need to be included in the final bundle, convert them to base64 instead.

Example:

.my-image {
-  background-image: url('my-image.png');
+  background-image: url('data:image/png;base64,iVBORw0...');
}

Or in a React component:

-  <img src="my-image.png" />
+  <img src="data:image/png;base64,iVBORw0..." />

FAQs

Package last updated on 11 Jun 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc