Socket
Socket
Sign inDemoInstall

@nearst/ui

Package Overview
Dependencies
Maintainers
10
Versions
195
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nearst/ui

UI framework for NearSt dashboard applications.


Version published
Weekly downloads
167
increased by7.05%
Maintainers
10
Weekly downloads
 
Created
Source

NearSt UI kit

A universal UI framework for NearSt dashboard applications.

Getting started

This UI framework is meant to be used in a React application. The easiest way to set up such an application is to use create-react-app. After creating a new project, add the @nearst/ui and the styled-components dependency:

npm i @nearst/ui styled-components

You can then start using the NearSt UI components in your app:

import { Root, Drawer } from '@nearst/ui'

const app = () => (
    <Root>
        <Drawer title='Test app'>
            <DrawerLink to='/' title='Dashboard' />
        </Drawer>
    </Root>
)

Development

All files in src/lib/ will be part of the NPM package.

The file src/index.js is used as a living example of the components. You can view it by running:

npm start

Guidelines

Some general things to consider when creating new components:

  • Components should not have style props. When you need custom styles, you should either take care of this by generalizing those styles and adding them as prop options (i.e. a Button with a color prop), or simply wrap them into a <div> in your client application where you can style children of that div by class name.
  • Every component should have propTypes, and where applicable sensible defaultProps values.
  • Try to be consistent with prop name usage. I.e. we use title as the name of the prop for a header-type value, so don't suddenly start using a name prop for that same purpose.

Components

Root

Base application wrapper.

Container

Wrapper for content.

Drawer

Responsive menu bar.

Props:

  • string title - title to display above the menu items
  • node children - a collection of Drawerlink elements

Menu item for inside Drawer.

Depending on the props passed to this component, the resulting component that is rendered becomes a style <NavLink>, <a> or <div>.

Props:

  • string title - Link title (required)
  • string to - React router to prop
  • string href - HTML link href
  • function onClick - Onclick handler
  • bool exact - React router exact prop
  • bool hidden - Whether to hide the menu itme
  • bool disable - Whether to disable the menu item

Block

Responsive page content container.

Props:

  • string title - Page title
  • string description - Page subtitle
  • string className - Custom content classname
  • bool loading - Whether to show loading indicator
  • function before - Content to show above/before page title
  • node children - Page content

Loader

Animated loading indicator.

Hamburger

Hamburger icon, used in Drawer component.

Icon

Google Material Icons helper.

Props:

  • string children - Icon name (required)
  • string color - Icon color, defaults to text color of parent
  • string className - Extra class name to append
  • object style - Custom CSS
  • func onClick - Custom onclick handler

Table

Tabs

Tab

Checkbox

FAQs

Package last updated on 10 Jul 2019

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