styled-form-component
v4.0.0
Published
The bootstrap form component created with styled-components
Downloads
386
Maintainers
Readme
styled-form-component
The bootstrap form component made with styled-components.
This is a modular approach to use bootstrap components for quick prototypes, as an entrypoint of your own component library, or if you need just one bootstrap component for your application.
Installation
npm install --save styled-form-component
npm install --save styled-components@^4.1.3 react@^16.7.0 # Peer dependencies
Usage
For detailed information take a look at the documentation.
import {
Button,
ButtonGroups,
ButtonToolbar,
} from 'styled-form-component';
const MyFormComponent = (props) => (
<form>
<FormGroup>
<label>Email address <FormControl type="email" placeholder="Enter email" /></label>
<FormText muted>We'll never share your email with anyone else.</FormText>
</FormGroup>
<FormGroup>
<label>Password <FormControl type="password" placeholder="Password" /></label>
</FormGroup>
<FormCheck>
<label><FormCheckInput type="checkbox" /> Check me out</label>
</FormCheck>
<FormGroup>
<Button block primary>Submit</Button>
</FormGroup>
</form>
);
const MyInputGroupComponent = (props) => (
<InputGroup>
<InputGroupPrepend>
<InputGroupText>@</InputGroupText>
</InputGroupPrepend>
<FormControl type="text" placeholder="Username" />
</InputGroup>
);
Properties
Properties which can be added to the component to change the visual appearance.
inline
only on FormCheck, FormControlPlainText Type: booleandisabled
only on FormCheckInput, FormControl Type: booleanreadonly
only on FormControl Type: booleanvalid
only on FormControl Type: booleaninvalid
only on FormControl Type: booleanformInline
only on FormControl, FormGroup Type: booleansm
small, only on FormControl, FormControlPlainText, FormGroup, InputGroup Type: booleanlg
large, only on FormControl, FormControlPlainText, FormGroup, InputGroup Type: booleanmultiple
only on FormControl Type: booleanselect
only on FormControl Type: booleantextarea
only on FormControl Type: booleanpill
only on FormControl Type: booleannoRadius
only on FormControl, FormGroup Type: booleanrow
only on FormGroup Type: booleannomb
no margin-bottom, only on FormGroup Type: booleanjustify
only on FormGroup Type: booleanmuted
only on FormText Type: boolean
License
MIT © Lukas Aichbauer