Socket
Socket
Sign inDemoInstall

@noths/elements

Package Overview
Dependencies
Maintainers
26
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@noths/elements

Component library for the NOTHS design system


Version published
Weekly downloads
2
decreased by-81.82%
Maintainers
26
Weekly downloads
 
Created
Source

Elements

About

The component library & design system for notonthehighstreet.com

Usage

Using a Component

import { Heading } from '@noths/elements';

<Heading />;

Next JS App SSR Setup + Importing via CDN

  1. Create custom _document file which uses the NothsElementsScript before any app code.
// _document.js

import { NothsElementsScript } from '@noths/elements';

class MyDocument extends Document {
  render() {
    return (
      <html>
        <Head />
        <body>
          <NothsElementsScript />
          <Main />
          <NextScript />
        </body>
      </html>
    );
  }
}
  1. Extend next webpack config like so with the ElementsWebpackPlugin. This sets @noths/elements as a webpack external when used in the browser, causing the app to use the library from a CDN.
// next.config.js

const { ElementsWebpackPlugin } = require('@noths/elements');

module.exports = {
  webpack: (webpackConfig, { isServer }) => {
    return isServer
      ? webpackConfig
      : {
          ...webpackConfig,

          externals: {
            react: 'React',
            'react-dom': 'ReactDOM',
            'styled-components': 'styled',
          },

          plugins: [].concat(webpackConfig.plugins, new ElementsWebpackPlugin()).filter(Boolean),
        };
  },
};

Contributing

To contribute and create new components please see CONTRIBUTING.md.

FAQs

Package last updated on 16 Jun 2022

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