Socket
Socket
Sign inDemoInstall

react-likert-scale

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-likert-scale

A React-based Likert Scale to collect data.


Version published
Weekly downloads
362
decreased by-29.02%
Maintainers
1
Weekly downloads
 
Created
Source

React Likert Scale

React Likert Scale is a React component that renders a Likert Scale. It is fully responsive and the styling can be customized by providing your own CSS styles.

Screenshot of Likert component

Installation

npm install --save react-likert-scale

Usage

React Likert Scale is a JavaScript library that can be used as an ES2015 Module or UMD.

ES2015 Module

import React from 'react';
import Likert from 'react-likert-scale';

export default () => {
  const likertOptions = {
    question: "What is your opinion of the President’s performance?",
    responses: [
      { value: 1, text: "Abysmal" },
      { value: 2, text: "Poor" },
      { value: 3, text: "Average" },
      { value: 4, text: "Good" },
      { value: 5, text: "Most Excellent, Ted" }
    ],
    picked: val => {
      console.log(val);
    }
  };
  return (
    <Likert {...likertOptions} />
  )
}

Likert Props

This component has three props:

  • question — (string) This is the prompt that displays above the options.
  • responses — (array of objects) These are your options. The value key is what is returned to the calling application in the picked callback.
  • picked — (function) Optionally, you can provide a callback function that returns the value of the option that a user clicks on.

Keywords

FAQs

Package last updated on 21 Jan 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