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

react-survey

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-survey

A small but powerful component to make unobstrusive survey pup-up

  • 1.7.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

React-Survey

npm version


React-Survey is a React component to add user-friendly, unobstrusive surveys to your site.

Live DEMO

Check a live Demo here

Who uses React-Survey

  • Orikishi

Installation

npm

npm i -S react-survey

yarn

yarn add react-survey

Quick Example

Data

const fakeSurvey = {
  name: "Satisfaction survey",
  id: 1,
  random: true,
  timeBeforePopUp: 5, // in seconds
  postUrl: "http://localhost:3000/surveys/1/participations",
  questions: [
    {
      text: "Are you finding the documentation site complete?",
      choices: [
        {
          text: "Yes",
          id: 1,
        },
        {
          text: "No",
          id: 2,
        },
      ],
      multiple: false,
      id: 1,
      required: true,
    },
    {
      text:
        "Do you think we should make a vanilla JS version of this component?",
      choices: [
        {
          text: "Yes",
          id: 3,
        },
        {
          text: "No",
          id: 4,
        },
      ],
      multiple: false,
      id: 2,
      required: true,
    },
    {
      text: "What functionnalities would you like to see next?",
      choices: [
        {
          text: "Overidable styles",
          id: 5,
        },
        {
          text: "Deactivate localStorage (for dev)",
          id: 6,
        },
        {
          text: "Animations",
          id: 7,
        },
      ],
      multiple: true,
      id: 3,
      required: false,
    },
  ],
  ending: {
    text:
      `Thank your for your answers!
      You can leave you email if you would like to maybe be contacted to answer some questions and help us.
      You can also write any comment you might have in the box below.`,
    email: true,
    freeSpeech: true,
  },
  messages: {
    errorMessage: "You have to select an option",
    welcomeMessage:
      "Hello! Thanks for checking us out! If you could answer these 3 easy questions it would really mean the world to us :)",
    nextMessage: "Next",
    endMessage: "End",
    endingMessage: "Thank you! Your answers have been recorded.",
    closeMessage: "Close",
  },
};

export { fakeSurvey };

React

import React from "react";
import ReactDOM from "react-dom";
import ReactSurvey from "react-survey";
import { fakeSurvey } from "./data";

ReactDOM.render(
  <ReactSurvey data={fakeSurvey} />,
  document.getElementById("root")
);

Keywords

FAQs

Package last updated on 04 Sep 2017

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