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

@r/widgets

Package Overview
Dependencies
Maintainers
7
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@r/widgets

A collection of React components and the Redux actions and reducers to accompany them

  • 0.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
decreased by-61.54%
Maintainers
7
Weekly downloads
 
Created
Source

r/widgets

A collection of helpful React components that can be used without much effort in a React + Redux environment

Installation

To install, use npm:

npm install -S @r/widgets

You'll also need to install the peer dependencies. Ex:

npm install -S lodash@4 react@15 react-redux@4 redux@3 reselect@2

Usage

Tooltip

First, plug in the reducer. Be sure that the reducer is named widgets in the store.

import widgets from '@r/widgets/reducer';
import { combineReducers } from 'redux';

const reducers = combineReducers({
  widgets,
  /* other reducers */
});

Create a tooltip and give it a target. Both the target and the tooltip must have the same id.

import React from 'react';
import { Tooltip, TooltipTarget } from '@r/widgets/tooltip';

class Foo extends React.Component {
  render() {
    return (
      <div>
        <div>
          <TooltipTarget id='test tooltip'>Mouse over me!</Target>
        </div>
        <Tooltip
          id='test tooltip'
          alignment={ Tooltip.ALIGN.ABOVE }
        >
          Hello!
        </Tooltip>
      </div>
    );
  }
}

And that's it! Tooltip and Target also come with a few configuration options:

Tooltip

  1. alignment: One of Tooltip.ALIGN.ABOVE, Tooltip.ALIGN.BELOW, Tooltip.ALIGN.LEFT, Tooltip.ALIGN.RIGHT
  2. offset: Number of pixels the tooltip should be separated from the target when shown.

Target

  1. type: Indicates what kind of action will trigger the tooltip. One of Target.TYPE.HOVER, Target.TYPE.CLICK, or Target.TYPE.BOTH.

Keywords

FAQs

Package last updated on 13 May 2016

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