4.0.0 • Published 6 years ago
styled-form-component v4.0.0
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 dependenciesUsage
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.
inlineonly on FormCheck, FormControlPlainText Type: booleandisabledonly on FormCheckInput, FormControl Type: booleanreadonlyonly on FormControl Type: booleanvalidonly on FormControl Type: booleaninvalidonly on FormControl Type: booleanformInlineonly on FormControl, FormGroup Type: booleansmsmall, only on FormControl, FormControlPlainText, FormGroup, InputGroup Type: booleanlglarge, only on FormControl, FormControlPlainText, FormGroup, InputGroup Type: booleanmultipleonly on FormControl Type: booleanselectonly on FormControl Type: booleantextareaonly on FormControl Type: booleanpillonly on FormControl Type: booleannoRadiusonly on FormControl, FormGroup Type: booleanrowonly on FormGroup Type: booleannombno margin-bottom, only on FormGroup Type: booleanjustifyonly on FormGroup Type: booleanmutedonly on FormText Type: boolean
License
MIT © Lukas Aichbauer