Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

formsy-semantic-ui-react

zabute2.3kMIT2.3.8TypeScript support: included

Formsy-React wrappers for Semantic-Ui-React's form Components

formsy-react, semantic-ui, semantic-ui-react, formsy, form, react, react-component, form-validation

readme

formsy-semantic-ui-react CI npm version

Quicky create formsy-react forms with Semantic-Ui-React's Form Components.

Installation

npm install (or yarn add) formsy-semantic-ui-react

You will also need formsy-react

npm install (or yarn add) formsy-react

Usage

// ES6
import {
  Form, Input, TextArea, Checkbox, Radio, RadioGroup, Dropdown, Select,
} from 'formsy-semantic-ui-react';
// ES5
var Form = require('formsy-semantic-ui-react').Form;
/** and so on for the rest of the Components **/
const App = (props) => {
  const errorLabel = <Label color="red" pointing/>

  return (
    <Form
      onValidSubmit={ props.onValidSubmit }
      loading={ props.isLoading }
    >
      <Form.Input
        name="email"
        label="Email"
        validations="isEmail"
        validationErrors={{ isEmail: 'Email not valid' }}
        errorLabel={ errorLabel }
      />
    </Form>
  )
}

Props

This library defines a couple of (non-required) props for more control over behavior/markup:

  • errorLabel (type: Node default: none)

    Used to Show validation errors next to the inputs. Any children get replaced by getErrorMessage()

  <Checkbox
    errorLabel={ <Label color="red" pointing="left"/> }/>
  />
  • instantValidation (type: bool default: false)

    Whether or not to show validation errors as soon as user starts typing. Only available on Input and Form.Input

  <Input
    instantValidation
  />

Examples

Go to the example folder to see more examples of how the components are used. To run the example app:

npm/yarn install
npm/yarn run example-app

Then go to localhost:8080

For more information on building and validating formsy-react forms, take a look at Formsy-React's Documentation

Tests

Tests are done using Mocha, chai, sinon, and enzyme on jsdom. To run the tests,

npm/yarn install
npm/yarn run test (or test:watch)

License: MIT

changelog

Changelog

All notable changes to this project will be documented in this file. Dates are displayed in UTC.

Generated by auto-changelog.

v2.3.8

  • fix: add name prop to onChange dropdown props b884fd1

v2.3.7

14 January 2025

v2.3.6

24 April 2024

  • Revert "fix: Form static props are recognized as any in TS" 12bd234

v2.3.5

24 April 2024

  • build(deps): bump browserify-sign from 4.2.1 to 4.2.2 in /example #142
  • build(deps): bump @babel/traverse from 7.11.0 to 7.23.2 in /example #140
  • build(deps): bump @babel/traverse from 7.22.8 to 7.23.2 #141
  • fix: Form static props are recognized as any in TS a8953c6

v2.3.4

20 September 2023

  • Bump @adobe/css-tools from 4.2.0 to 4.3.1 #139
  • fix: move @types/hoist-non-react-statics from deps to devDeps cd72fb6

v2.3.3

27 July 2023

  • fix: remove weird props that becomes mandatory ed08cd9

v2.3.2

27 July 2023

  • fix: remove formRadioGroup since the inner field applies the error correctly 4f479c1

v2.3.1

27 July 2023

  • fix: remove double disable class 4304469

v2.3.0

27 July 2023

  • Bump word-wrap from 1.2.3 to 1.2.4 #136
  • Bump word-wrap from 1.2.3 to 1.2.4 in /example #137
  • Bump semver from 5.7.1 to 5.7.2 #135
  • Bump semver from 5.7.1 to 5.7.2 in /example #134
  • Bump http-cache-semantics from 4.1.0 to 4.1.1 #133
  • Bump json5 from 1.0.1 to 1.0.2 #132
  • Bump minimatch from 3.0.4 to 3.1.2 in /example #131
  • Bump json5 from 1.0.1 to 1.0.2 in /example #130
  • fix: handle radio group props properly, closes #138 #138
  • Bump deps 2364fed

v2.2.4

9 December 2022

  • Bump qs from 6.5.2 to 6.5.3 in /example #129
  • Bump qs from 6.5.2 to 6.5.3 #128
  • Bump minimatch from 3.0.4 to 3.1.2 #127
  • Bump decode-uri-component from 0.2.0 to 0.2.2 in /example #126
  • Bump decode-uri-component from 0.2.0 to 0.2.2 #125

v2.2.3

9 November 2022

  • fix: add input value type to generics in a less destructive place d8d01ae

v2.2.2

9 November 2022

  • fix: add input value type to generics 7584bf4

v2.2.1

9 November 2022

v2.2.0

9 November 2022

  • Bump shelljs from 0.8.4 to 0.8.5 #124
  • Bump minimist from 1.2.5 to 1.2.7 #123
  • Bump tmpl from 1.0.4 to 1.0.5 #122
  • Migrate to React testing lib #121
  • Bump terser from 4.8.0 to 4.8.1 #120
  • Bump minimist from 1.2.5 to 1.2.6 #119
  • Bump node-fetch from 2.6.1 to 2.6.7 #118
  • Bump lodash-es from 4.17.20 to 4.17.21 #117
  • Bump minimist from 1.2.5 to 1.2.6 in /example #116
  • Bump shelljs from 0.8.4 to 0.8.5 #115
  • Bump tmpl from 1.0.4 to 1.0.5 #114
  • Update ci deps 41e4d29
  • Bump deps 2e63e13
  • fix: Don't pass label prop to Semantic-ui components 343bbc0

v2.1.3

21 September 2021

  • fix: exclude inputClassName from input props #113
  • Bump color-string from 1.5.3 to 1.6.0 in /example #111
  • Bump path-parse from 1.0.6 to 1.0.7 in /example #110
  • Bump path-parse from 1.0.6 to 1.0.7 #109
  • Bump hosted-git-info from 2.8.8 to 2.8.9 #104

v2.1.2

10 June 2021

  • Bump normalize-url from 4.5.0 to 4.5.1 #103
  • Bump glob-parent from 5.1.1 to 5.1.2 #102
  • Bump ws from 5.2.2 to 5.2.3 in /example #101
  • Bump trim-newlines from 3.0.0 to 3.0.1 #100
  • Bump ws from 7.4.4 to 7.4.6 #99
  • Bump browserslist from 4.14.0 to 4.16.6 in /example #98
  • Bump browserslist from 4.14.0 to 4.16.6 #97
  • Bump lodash from 4.17.20 to 4.17.21 in /example #96
  • Bump lodash from 4.17.20 to 4.17.21 #95
  • Bump handlebars from 4.7.6 to 4.7.7 #94
  • Bump y18n from 4.0.0 to 4.0.1 #93
  • Bump elliptic from 6.5.3 to 6.5.4 in /example #92

v2.1.1

14 March 2021

v2.1.0

20 January 2021

  • Bump ini from 1.3.5 to 1.3.7 #91
  • Bump node-fetch from 2.6.0 to 2.6.1 #89
  • Bump semantic-ui-react version 07a0951
  • Create ISSUE_TEMPLATE.md ead713f

v2.0.6

28 August 2020

  • fix: set a boolean value when checkbox without value / defaultChecked #88
  • Add auto-changelog & np to ease releases 1c7eeaa

v2.0.5

28 August 2020

  • fix: use the correct module file name d753079

v2.0.4

25 August 2020

  • fix: stop className leakage to the form itself 5bb73f3

v2.0.3

24 August 2020

  • Add support for textarea types 0a68b16

v2.0.2

24 August 2020

v2.0.1

19 August 2020

  • Migrate build to use tsdx #87
  • Migrate to tsdx 440468e
  • Add github work flow cabb046
  • fix(types): Fix standalone components types b6d0832

v1.2.0

12 August 2020

  • fix(#58) - allow render Semantic-ui input as the input of FormsyInput #82
  • Ignore Formsy's v2.1.0 additional validations props #84
  • Bump react-dom from 16.1.1 to 16.1.2 #86
  • Bump websocket-extensions from 0.1.3 to 0.1.4 #85
  • Update .travis.yml #78
  • Update to formsy 2 #77
  • Update to formsy v2 7121827
  • Upgrade to latest babel 936c79b
  • Add GH-pages f27cc42

v0.3.5

25 April 2019

  • fix(#37) - prevent inline prop to propagate to the input #57
  • fix(Dropdown, Input): don't render label element if the label is empty #56

v0.3.4

10 March 2019

  • Add semantic-ui types #54
  • Pass dropdownProps to FormSelect #52
  • pass dropdownProps to FormSelect 46bc7c2

v0.3.3

10 April 2018

  • update old links to formsry react reopo and fix incorrect errorLabel type 8a22648
  • fix react and react-dom peerDep ranges 04efd20

v0.3.2

20 January 2018

  • Include 'node' PropType as one of label types #28
  • Update FormExamples.js #26
  • Update InputExamples.js #25
  • add missing e/data params in onBlur event #23
  • Fix FormsyDropdown onBlur event do not occur. #20
  • Fix instance of TextArea to Form.TextArea for "Avoid nesting Form. #12
  • Fixed initial value warning if it is empty and not multiple. #10
  • Use Select for the value of 'as' in Dropdown. #8
  • version bump to 0.2.0 and update peerDepenencies (fixes #4) #4
  • rebase to master && fix conflicts b2d791f
  • added yarn lockfile 9b18fbc
  • initial commit 95d8c00