Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@trendmicro/react-form-control

Package Overview
Dependencies
Maintainers
4
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@trendmicro/react-form-control

React Form Control component

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
781
decreased by-2.86%
Maintainers
4
Weekly downloads
 
Created
Source

react-form-control build status Coverage Status

NPM

React Form Control

Demo: https://trendmicro-frontend.github.io/react-form-control

Installation

  1. Install the latest version of react and react-form-control:
npm install --save react @trendmicro/react-form-control
  1. At this point you can import @trendmicro/react-form-control and its styles in your application as follows:
import FormControl, { Input, Select, Textarea } from '@trendmicro/react-form-control';

// Be sure to include styles at some point, probably during your bootstraping
import '@trendmicro/react-form-control/dist/react-form-control.css';

Overview

Form controls

The <FormControl> component renders a form control with block-level styling (display: block and width: 100%). Supported textual form controls includes <Input>, <Select>, and <Textarea>.

<FormGroup>
    <label>Email address</label>
    <Input type="text" placeholder="name@example.com" />
</FormGroup>
<FormGroup>
    <label>Example select</label>
    <Select defaultValue="1">
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
        <option value="4">4</option>
        <option value="5">5</option>
    </Select>
</FormGroup>
<FormGroup>
    <label>Example multiple select</label>
    <Select multiple defaultValue="1">
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
        <option value="4">4</option>
        <option value="5">5</option>
    </Select>
</FormGroup>
<FormGroup>
    <label>Example textarea</label>
    <Textarea rows={3} />
</FormGroup>

Form groups

Using the <FormGroup> component is the easiest way to add some structure to forms, it provides a flexible way that encourages proper grouping of labels, controls, and form validation messaging.

The <FormGroup> component is not provided here, but you can use styled-components to style with plain CSS styles. By default, it only applies margin-bottom as below:

const FormGroup = styled.div`
    margin-bottom: 12px;
`;

API

Properties

FromControl
NameTypeDefaultDescription
tagelement'div'
lgboolean
mdbooleanDefaults to 'md' if nothing is specified.
smboolean
Input
NameTypeDefaultDescription
tagelement'input'
lgboolean
mdbooleanDefaults to 'md' if nothing is specified.
smboolean
Select
NameTypeDefaultDescription
tagelement'select'
lgboolean
mdbooleanDefaults to 'md' if nothing is specified.
smboolean
Textarea
NameTypeDefaultDescription
tagelement'textarea'

License

MIT

Keywords

FAQs

Package last updated on 14 Dec 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