<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>component Archives - Codeplaners</title>
	<atom:link href="https://codeplaners.com/tag/component/feed/" rel="self" type="application/rss+xml" />
	<link>https://codeplaners.com/tag/component/</link>
	<description>Code Solution</description>
	<lastBuildDate>Wed, 21 Oct 2020 07:07:09 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>

<image>
	<url>https://codeplaners.com/wp-content/uploads/2020/09/cropped-favicon-social-32x32.png</url>
	<title>component Archives - Codeplaners</title>
	<link>https://codeplaners.com/tag/component/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to create react bootstrap slider</title>
		<link>https://codeplaners.com/how-to-create-react-bootstrap-slider/</link>
					<comments>https://codeplaners.com/how-to-create-react-bootstrap-slider/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Wed, 21 Oct 2020 07:00:36 +0000</pubDate>
				<category><![CDATA[Bootstrap]]></category>
		<category><![CDATA[Reacts]]></category>
		<category><![CDATA[bootstrap]]></category>
		<category><![CDATA[bootstrap 4]]></category>
		<category><![CDATA[bootstrap slider]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[react js slider]]></category>
		<category><![CDATA[react-component]]></category>
		<category><![CDATA[slider]]></category>
		<guid isPermaLink="false">http://localhost/codeplaners/?p=313</guid>

					<description><![CDATA[<p>Interoduction The Build React App was used to bootstrap this project. It was then ejected because of a problem with jQuery (see below). A ReactJS wrapper with Bootstrap for the Seiyria Bootstrap Slider part. Start with version 3.0.0, we only support Bootstrap 4. If you are still using Bootstrap 3, please use version 2.2.3. How &#8230; <a href="https://codeplaners.com/how-to-create-react-bootstrap-slider/" class="more-link">Continue reading<span class="screen-reader-text"> "How to create react bootstrap slider"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-create-react-bootstrap-slider/">How to create react bootstrap slider</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><strong>Interoduction</strong></p>
<p>The Build React App was used to bootstrap this project. It was then ejected because of a problem with jQuery (see below).</p>
<p>A ReactJS wrapper with Bootstrap for the Seiyria Bootstrap Slider part. Start with version 3.0.0, we only support Bootstrap 4. If you are still using Bootstrap 3, please use version 2.2.3.</p>
<p><strong>How to install</strong></p>
<p>Install from npm with:</p>
<pre><code>npm install --save react-bootstrap-slider
</code></pre>
<p>or</p>
<pre><code>yarn add react-bootstrap-slider</code></pre>
<p><strong>Import like so for ES6:</strong></p>
<pre><code>import ReactBootstrapSlider from 'react-bootstrap-slider';
</code></pre>
<p>The control is implemented in the UMD format, so AMD / RequireJS should also function, but I haven&#8217;t checked it.</p>
<p><strong>Peer Dependencies</strong></p>
<p>For react-bootstrap-slider, React, React Dom, and Bootstrap are classified as peer dependencies (peerDependencies section of package.json). When you install this component in your own project, it won&#8217;t be automatically installed. If you have not already done so, you will need to install them yourself, as part of that project. If you do not include them yet, this command will install them for you:</p>
<pre><code>npm install react react-dom prop-types bootstrap@^4 --save
</code></pre>
<p>or</p>
<pre><code>yarn add react react-dom prop-types bootstrap@^4</code></pre>
<p><strong>jQuery</strong></p>
<p>If it detects it in your project configuration, the bootstrap-slider part-and thus, react-bootstrap-slider-will work with jQuery, but it isn&#8217;t a necessity. Without jQuery, it worked great. However, if you are using Webpack or Browserify to create your project, if jQuery is not present, you can get a &#8220;missing dependency&#8221; create error. This is a known upstream bootstrap-slider problem. See How do I remove the JQuery optional dependency from my build? Readme f on the Bootstrap Slider&#8217;s on the Bootstrap Slider on how this problem can be worked around. By reviewing the /examples / config / webpack.config.js file and searching for &#8216;jQuery, you can also see how I did it.</p>
<p>You also need to make sure you have included the CSS file of the bootstrap-slider in your build, otherwise the control will be null! Of course, you&#8217;ll also need Bootstrap&#8217;s own CSS file as well. If you are using Webpack, which you would be if you have a project based on Create React App, then you can directly import the CSS file into your build, like this:</p>
<pre class="prettyprint prettyprinted" data-spm-anchor-id="a2c6h.14275010.0.i10.22924ce7kb68Zr"><code class="language-JavaScript"><span class="kwd">import</span> <span class="str">"bootstrap/dist/css/bootstrap.css"</span><span class="pun">;</span>
<span class="kwd">import</span> <span class="str">"bootstrap-slider/dist/css/bootstrap-slider.css"</span></code></pre>
<p>Those two imports need to be in your top-level JavaScript file, e.g. App.js.</p>
<p>Or you can simply add the files as links in your HTML file as a link e.g.:</p>
<pre class="prettyprint prettyprinted"><code class="language-HTML"><span class="tag">&lt;link</span> <span class="atn">rel</span><span class="pun">=</span><span class="atv">"stylesheet"</span> <span class="atn">href</span><span class="pun">=</span><span class="atv">"//stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css"</span> <span class="tag">/&gt;</span>
    <span class="tag">&lt;script</span> <span class="atn">src</span><span class="pun">=</span><span class="atv">"//cdnjs.cloudflare.com/ajax/libs/bootstrap-slider/11.0.2/bootstrap-slider.min.js"</span><span class="tag">&gt;&lt;/script&gt;</span></code></pre>
<p data-spm-anchor-id="a2c6h.14275010.0.i11.22924ce7kb68Zr">Checking that the versions match those of Bootstrap and Bootstrap Slider themselves.</p>
<p data-spm-anchor-id="a2c6h.14275010.0.i12.22924ce7kb68Zr"><strong>How to create react-bootstrap-slider</strong></p>
<p>Here&#8217;s an example of how you might call it in your ReactJS&#8217;s render method:</p>
<pre class="prettyprint prettyprinted"><code class="language-JavaScript"><span class="tag">&lt;ReactBootstrapSlider</span>
    <span class="atn">value</span><span class="pun">=</span><span class="atv">{this.state.currentValue}</span>
    <span class="atn">change</span><span class="pun">=</span><span class="atv">{this.changeValue}</span>
    <span class="atn">slideStop</span><span class="pun">=</span><span class="atv">{this.changeValue}</span>
    <span class="atn">step</span><span class="pun">=</span><span class="atv">{this.state.step}</span>
    <span class="atn">max</span><span class="pun">=</span><span class="atv">{this.state.max}</span>
    <span class="atn">min</span><span class="pun">=</span><span class="atv">{this.state.min}</span>
    <span class="atn">orientation</span><span class="pun">=</span><span class="atv">"vertical"</span>
    <span class="atn">reversed</span><span class="pun">=</span><span class="atv">{true}</span>
    <span class="atn">disabled</span><span class="pun">=</span><span class="atv">"disabled"</span> <span class="tag">/&gt;</span></code></pre>
<p data-spm-anchor-id="a2c6h.14275010.0.i13.22924ce7kb68Zr">The <strong>value</strong>, <strong>step</strong>, <strong>max,</strong> and <strong>min</strong> parameters should be self-explanatory. The <code>change</code> event is the callback method that will be called when the slider actually changes. (NB: this is the <code>change</code> event for the Bootstrap slider.) As of version 1.1.2, there is a new <code>slideStop</code> event, which only triggers when you&#8217;ve <em>finished</em> moving the slider (i.e. you release it). This makes <code>slideStop</code> a deal less &#8220;chatty&#8221; than the <code>change</code> event. Decide which one you need; you&#8217;ll only ever need one or the other (unlike my example code above!).</p>
<p>If the optional parameter <strong>disabled</strong> is included, and is set to &#8220;disabled&#8221;, then the slider will display in a disabled state. If the parameter is not included, or is set to anything else except &#8220;disabled&#8221;, then the slider control will be enabled.</p>
<p>The default <strong>orientation</strong> value is &#8216;horizontal&#8217;, so you only need to include that prop if you want to set it to &#8216;vertical&#8217;.</p>
<p>If <strong>value</strong> is a two member array, then the slider will have two handles: minimum and maximum. You should also pass win a <strong>range</strong> parameter set to true in this case.</p>
<p>As of version 1.0.5, other values passed into the component will also passed into the underlying bootstrap-slider component via the Object Spread Operator that&#8217;s been proposed for ES2017 (yes, that&#8217;s how cutting edge I am!!). See <a href="https://github.com/seiyria/bootstrap-slider">seyria&#8217;s documentation</a> for a full list of these. Those parameters have not all been tested yet but the <code>reversed</code> parameter definitely works, and I have included this in the demo of the vertical slider.</p>
<p>Version 1.0.6 fixed an issue that prevented ticks props from being rendered. Pass in ticks props like so:</p>
<pre class="prettyprint prettyprinted"><code class="language-JavaScript"><span class="pln">ticks </span><span class="pun">=</span> <span class="pun">{[</span><span class="lit">0</span><span class="pun">,</span> <span class="lit">100</span><span class="pun">,</span> <span class="lit">200</span><span class="pun">,</span> <span class="lit">300</span><span class="pun">,</span> <span class="lit">400</span><span class="pun">]}</span><span class="pln">
ticks_labels </span><span class="pun">=</span> <span class="pun">{[</span><span class="str">"$0"</span><span class="pun">,</span> <span class="str">"$100"</span><span class="pun">,</span> <span class="str">"$200"</span><span class="pun">,</span> <span class="str">"$300"</span><span class="pun">,</span> <span class="str">"$400"</span><span class="pun">]}</span><span class="pln">
ticks_snap_bounds </span><span class="pun">=</span> <span class="pun">{</span> <span class="lit">30</span> <span class="pun">}</span></code></pre>
<h2 data-spm-anchor-id="a2c6h.14275010.0.i15.22924ce7kb68Zr">Current Tags</h2>
<ul>
<li data-spm-anchor-id="a2c6h.14275010.0.i14.22924ce7kb68Zr">3.0.0                                &#8230;         <strong>  latest (4 months ago)</strong></li>
</ul>
<h2>28 Versions</h2>
<ul>
<li>3.0.0                                &#8230;           <strong>4 months ago</strong></li>
<li>2.2.3                                &#8230;           <strong>9 months ago</strong></li>
<li>2.2.2                                &#8230;           <strong>2 years ago</strong></li>
<li>2.2.1                                &#8230;           <strong>2 years ago</strong></li>
<li>2.2.0                                &#8230;         <strong>  2 years ago</strong></li>
<li>2.1.5                                &#8230;           <strong>2 years ago</strong></li>
<li>2.1.4                                &#8230;           <strong>3 years ago</strong></li>
<li>2.1.3                                &#8230;         <strong>  3 years ago</strong></li>
<li>2.1.2                                &#8230;           <strong>3 years ago</strong></li>
<li>2.1.1                                &#8230;          <strong> 3 years ago</strong></li>
<li>2.1.0                                &#8230;          <strong> 3 years ago</strong></li>
<li>2.0.1                                &#8230;          <strong> 3 years ago</strong></li>
<li>2.0.0                                &#8230;          <strong> 3 years ago</strong></li>
<li>1.1.7                                &#8230;           <strong>4 years ago</strong></li>
<li>1.1.6                                &#8230;          <strong> 4 years ago</strong></li>
<li>1.1.5                                &#8230;           <strong>4 years ago</strong></li>
<li>1.1.4                                &#8230;          <strong> 4 years ago</strong></li>
<li>1.1.3                                &#8230;          <strong> 4 years ago</strong></li>
<li>1.1.2                                &#8230;           <strong>4 years ago</strong></li>
<li>1.1.1                                &#8230;           <strong>4 years ago</strong></li>
<li>1.1.0                                &#8230;          <strong> 4 years ago</strong></li>
<li>1.0.6                                &#8230;           <strong>4 years ago</strong></li>
<li>1.0.5                                &#8230;           <strong>4 years ago</strong></li>
<li>1.0.4                                &#8230;          <strong> 4 years ago</strong></li>
<li>1.0.3                                &#8230;           <strong>4 years ago</strong></li>
<li>1.0.2                                &#8230;         <strong>  4 years ago</strong></li>
<li>1.0.1                                &#8230;           <strong>4 years ago</strong></li>
<li data-spm-anchor-id="a2c6h.14275010.0.i16.22924ce7kb68Zr">1.0.0                                &#8230;          <strong> 5 years ago</strong></li>
</ul>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-create-react-bootstrap-slider/">How to create react bootstrap slider</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/how-to-create-react-bootstrap-slider/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
