Skip to content

im-ian/react-survey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Survey

2018~2019년에 제작했던 React 설문 모듈입니다. 아카이브 용도로 업로드 되었습니다.

설문 폼을 생성하는 Editor와 생성된 폼을 기반으로 응답을 수집하는 Viewer가 포함되어 있습니다.

service_capture

Installation

npm install @im-ian/react-survey

# or

yarn add @im-ian/react-survey

How to use?

import { useState } from 'react';
import { Editor, Viewer, EditorType } from '@im-ian/react-survey';

const View = () => {
  const [survey, setSurvey] = useState<EditorType.ISurveyResult>();

  return (
    <>
      <Editor onSubmit={survey => setSurvey(survey)} />
      {survey && (
        <Viewer
          survey={survey}
          onSubmit={result => {
            console.log(result);
          }}
        />
      )}
    </>
  );
};

export default View;
/* write on your css file. */
@import url(https://cdn.syncfusion.com/ej2/material.css);

Feature

Editor

property required value
submitButtonOptions N { text: string; visible: boolean; }
defaultValue N {}: EditorType.ISurveyResult
onChange N (result: EditorType.ISurveyResult) => void
onSubmit N (result: EditorType.ISurveyResult) => void

Viewer

property required value
survey Y EditorType.ISurveyResult
submitButtonOptions N { text: string; visible: boolean; }
onSubmit N (result: EditorType.ISurveyResult) => void

About

리액트 설문 모듈입니다.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages