
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
bootstrap-input-react
Advanced tools
Bootstrap (or not) inputs for react that manage themselves.
npm install bootstrap-input-react
A single component that creates a bootstrap 4 input of one of the following common input types:
Each input component does all the work for you. Handling input and setting state. A minimum number of properties are required:
Example:
import BootstrapInput from "bootstrap-input-react";
export class Content extends Component {
constructor(props) {
super(props);
this.state = {
numeric: 100,
};
}
render() {
return (<div> <BootstrapInput parent={this} name="numeric"/></div>)
}
}
Creates a text input using the state property of numeric with the initial value of 100 . It will then be available as:
this.state.numeric
Use the type property to set the input type. Supported:
Basically any other HTML input type can be used. Select, checkbox and textarea have specific style and label handling. Any other property will be passed along to the HTML input element.
To create a select input, set the type="select", and provide a list of the select options as either a simple list or a list of objects with label and value. As follows:
<BootstrapInput parent={this} name="select" type="select" label="select"
options={[{label: 'a',value:1}, {label: 'b',value: 2}, {label: 'c',value: 3}]}
/>
<BootstrapInput parent={this} name="selectSimple" type="select" label="select simple"
options={[4,5,6]}
/>
Very similar to the select input. Use type="radio" and provide a list of the radio options as either a simple list or a list of objects with label and value. As follows:
<BootstrapInput parent={this} name="radio" type="radio" label={"radio"} options={[{label: 'a',value:1}, {label: 'b',value: 2}, {label: 'c',value: 3}]}/>
The state value, provided as name, will have the value of the selected radio option.
A checkbox control is the same as an input excepting the state value will be true or false. Example:
<BootstrapInput parent={this} name="checkbox" type="checkbox" label="Checkbox"/>
To properly style the inputs you should have bootstrap 4 CSS included somewhere
FAQs
Bootstrap inputs for react that manage themselves
The npm package bootstrap-input-react receives a total of 13 weekly downloads. As such, bootstrap-input-react popularity was classified as not popular.
We found that bootstrap-input-react demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.