<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Cruip - Medium]]></title>
        <description><![CDATA[Beautifully designed landing page templates for startups - Medium]]></description>
        <link>https://medium.com/cruip?source=rss----15e394aa5deb---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Cruip - Medium</title>
            <link>https://medium.com/cruip?source=rss----15e394aa5deb---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 17:36:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/cruip" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to build a pricing slider — Vue]]></title>
            <link>https://medium.com/cruip/how-to-build-a-pricing-slider-vue-8b2a25e8389e?source=rss----15e394aa5deb---4</link>
            <guid isPermaLink="false">https://medium.com/p/8b2a25e8389e</guid>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[vue]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Pasquale Vitiello]]></dc:creator>
            <pubDate>Mon, 23 Mar 2020 14:38:17 GMT</pubDate>
            <atom:updated>2020-03-23T14:38:17.421Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to build a pricing slider — Vue</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WYTi-Nur2wUpAPq7Zwyz8A.png" /></figure><p>In the last article of this series, I am going to show you how to create the same exact <strong>pricing component in VueJS</strong>.</p><p>That’s going to be a piece of cake since it’s just a matter of following the same <a href="https://medium.com/cruip/how-to-build-a-pricing-slider-react-71545d81d63d">approach I used for React</a>.</p><p>Let’s create a <strong>Pricing.vue</strong> template file, and add the HTML 👇</p><pre>&lt;template&gt;<br>  &lt;div class=&quot;pricing&quot;&gt;<br>    &lt;div class=&quot;pricing-slider center-content&quot;&gt;<br>      &lt;label class=&quot;form-slider&quot;&gt;<br>        &lt;span&gt;How many users do you have?&lt;/span&gt;<br>        &lt;input type=&quot;range&quot;&gt;<br>      &lt;/label&gt;<br>      &lt;div class=&quot;pricing-slider-value&quot;&gt;<br>        &lt;!-- {{ Current slider value }} --&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;</pre><pre>    &lt;div class=&quot;pricing-items&quot;&gt;<br>      &lt;div class=&quot;pricing-item&quot;&gt;<br>        &lt;div class=&quot;pricing-item-inner&quot;&gt;<br>          &lt;div class=&quot;pricing-item-content&quot;&gt;<br>            &lt;div class=&quot;pricing-item-header center-content&quot;&gt;<br>              &lt;div class=&quot;pricing-item-title&quot;&gt;Basic&lt;/div&gt;<br>              &lt;div class=&quot;pricing-item-price&quot;&gt;<br>                &lt;span class=&quot;pricing-item-price-currency&quot;&gt;&lt;/span&gt;<br>                &lt;span class=&quot;pricing-item-price-amount&quot;&gt;Free&lt;/span&gt;<br>              &lt;/div&gt;<br>            &lt;/div&gt;<br>            &lt;div class=&quot;pricing-item-features&quot;&gt;<br>              &lt;ul class=&quot;pricing-item-features-list&quot;&gt;<br>                &lt;li class=&quot;is-checked&quot;&gt;Excepteur sint occaecat&lt;/li&gt;<br>                &lt;li class=&quot;is-checked&quot;&gt;Excepteur sint occaecat&lt;/li&gt;<br>                &lt;li class=&quot;is-checked&quot;&gt;Excepteur sint occaecat&lt;/li&gt;<br>                &lt;li&gt;Excepteur sint occaecat&lt;/li&gt;<br>                &lt;li&gt;Excepteur sint occaecat&lt;/li&gt;<br>              &lt;/ul&gt;<br>            &lt;/div&gt;<br>          &lt;/div&gt;<br>          &lt;div class=&quot;pricing-item-cta&quot;&gt;<br>            &lt;a class=&quot;button&quot; href=&quot;http://cruip.com/&quot;&gt;Buy Now&lt;/a&gt;<br>          &lt;/div&gt;<br>        &lt;/div&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/template&gt;</pre><pre>&lt;script&gt;<br>export default {<br>  name: &quot;Pricing&quot;<br>};<br>&lt;/script&gt;</pre><h3>Shaping input and output data</h3><p>We already have a <strong>data scheme</strong> with <em>input</em> and <em>output</em> values (check out the <a href="https://medium.com/cruip/how-to-build-a-pricing-slider-html-vanilla-js-c233b40751e2">first article</a> of this series to know more).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Eu-9GRIzSK8GcIywvawQRQ.png" /></figure><p>We will use the data object to contain those values.</p><h3>Defining the component data</h3><p>React has a built-in data function that returns an object. Here is where we will store <em>input range</em> and <em>data scheme</em> values.</p><pre>data() {<br>  return {<br>    priceInputValue: &quot;0&quot;,   // initial input value<br>    priceInput: {           // slider values<br>      0: &quot;1,000&quot;,<br>      1: &quot;1,250&quot;,<br>      2: &quot;1,500&quot;,<br>      3: &quot;2,000&quot;,<br>      4: &quot;2,500&quot;,<br>      5: &quot;3,500&quot;,<br>      6: &quot;6,000&quot;,<br>      7: &quot;15,000&quot;,<br>      8: &quot;50,000&quot;,<br>      9: &quot;50,000+&quot;<br>    },<br>    priceOutput: {          // output values<br>      plan1: {<br>        0: [&quot;&quot;, &quot;Free&quot;, &quot;&quot;],<br>        1: [&quot;$&quot;, &quot;13&quot;, &quot;/m&quot;],<br>        2: [&quot;$&quot;, &quot;17&quot;, &quot;/m&quot;],<br>        3: [&quot;$&quot;, &quot;21&quot;, &quot;/m&quot;],<br>        4: [&quot;$&quot;, &quot;25&quot;, &quot;/m&quot;],<br>        5: [&quot;$&quot;, &quot;42&quot;, &quot;/m&quot;],<br>        6: [&quot;$&quot;, &quot;58&quot;, &quot;/m&quot;],<br>        7: [&quot;$&quot;, &quot;117&quot;, &quot;/m&quot;],<br>        8: [&quot;$&quot;, &quot;208&quot;, &quot;/m&quot;],<br>        9: [&quot;&quot;, &quot;Contact Us&quot;, &quot;&quot;]<br>      }<br>    }<br>  };<br>}</pre><p>Now bind the priceInputValue to the input range with the v-model directive</p><pre>&lt;input type=&quot;range&quot; v-model=&quot;priceInputValue&quot; /&gt;</pre><h3>Setting range slider attributes</h3><p>Create a ref on the <strong>input range element</strong></p><pre>&lt;input type=&quot;range&quot; ref=&quot;slider&quot; v-model=&quot;priceInputValue&quot;&gt;</pre><p>Let’s set the range slider min, max attributes, right after the component output has been rendered to the DOM 👇</p><pre>mounted() {<br>  this.$refs.slider.setAttribute(&quot;min&quot;, 0);<br>  this.$refs.slider.setAttribute(<br>    &quot;max&quot;,<br>    Object.keys(this.priceInput).length - 1<br>  );<br>}</pre><p>We have now a range slider whose values go from 0 to 9! 🙌</p><p>Here is a recap of what we have built so far:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2Ft18zr&amp;display_name=CodeSandbox&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2Ft18zr&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2Ft18zr%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/fe6344ec6541d8b46aa5343a6d258883/href">https://medium.com/media/fe6344ec6541d8b46aa5343a6d258883/href</a></iframe><h3>Binding input and output data</h3><p>We have a working range slider, but it is still disconnected from the visualized price.</p><p>We need another method that <strong>retrieves the data to be outputted</strong>, accordingly with the current input value</p><pre>getPricingData(obj, pos) {<br>  return pos !== undefined<br>    ? obj[this.priceInputValue][pos]<br>    : obj[this.priceInputValue];<br>}</pre><p>This method has two parameters:</p><ul><li>obj - The input or output object we want to retrieve data from</li><li>pos (optional) - The position of a required element in the array, if there is any. It is required for the <em>plan</em> objects, since to each key corresponds an array of values (e.g. 0: [&quot;&quot;, &quot;Free&quot;, &quot;&quot;], ...).</li></ul><p>So, to output the <strong>current slider value</strong>, we will call the method like this 👇</p><pre>&lt;div class=&quot;pricing-slider-value&quot;&gt;{{ getPricingData(priceInput) }}&lt;/div&gt;</pre><p>And here is how to output the <strong>price data</strong> instead 👇</p><pre>&lt;div class=&quot;pricing-item-price&quot;&gt;<br>  &lt;span class=&quot;pricing-item-price-currency&quot;&gt;<br>    {{ getPricingData(this.priceOutput.plan1, 0) }}<br>  &lt;/span&gt;<br>  &lt;span class=&quot;pricing-item-price-amount&quot;&gt;<br>    {{ getPricingData(this.priceOutput.plan1, 1) }}<br>  &lt;/span&gt;<br>  {{ getPricingData(this.priceOutput.plan1, 2) }}<br>&lt;/div&gt;</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2Fhk798&amp;display_name=CodeSandbox&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2Fhk798&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2Fhk798%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/09f60c8a7073fafa2b687a6a42202013/href">https://medium.com/media/09f60c8a7073fafa2b687a6a42202013/href</a></iframe><h3>Adjusting the slider value element position</h3><p>Almost there. 🏁 We want the slider value to be following the slider thumb.</p><p>We need a new method for that but, before proceeding, there is another DOM element that needs to be referenced.</p><p>Create a ref for the <strong>current slider value</strong></p><pre>&lt;div ref=&quot;sliderValue&quot; class=&quot;pricing-slider-value&quot;&gt;{{ getPricingData(priceInput) }}&lt;/div&gt;</pre><p>Get the slider thumb size from a CSS property 👍</p><pre>this.thumbSize = parseInt(<br>  window<br>    .getComputedStyle(this.$refs.sliderValue)<br>    .getPropertyValue(&quot;--thumb-size&quot;),<br>  10<br>);</pre><p>Now that we have referenced the .pricing-slider-value element, let&#39;s create the method we need.</p><pre>handleSliderValuePosition(input) {<br>  const multiplier = input.value / input.max;<br>  const thumbOffset = this.thumbSize * multiplier;<br>  const priceInputOffset =<br>    (this.thumbSize - this.$refs.sliderValue.clientWidth) / 2;<br>  this.$refs.sliderValue.style.left =<br>    input.clientWidth * multiplier - thumbOffset + priceInputOffset + &quot;px&quot;;<br>},</pre><p>Here is a visual representation of what the method does 👇</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UK7RfohR_Vh0kYBlEBVW5w.png" /></figure><p>Call the method as soon as the component has rendered.</p><pre>mounted() {<br>  this.handleSliderValuePosition(this.$refs.slider);<br>}</pre><p>We also need to call that method every time the input range value changes, so let’s use the v-on directive to listen to element input event:</p><pre>&lt;input<br>  type=&quot;range&quot;<br>  ref=&quot;slider&quot;<br>  v-model=&quot;priceInputValue&quot;<br>  @input=&quot;handleSliderValuePosition($event.target)&quot;<br>&gt;</pre><h3>Conclusion</h3><p>Here is the final result. Click on <em>Open Sandbox</em> to see the full code.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2F0gngs&amp;display_name=CodeSandbox&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2F0gngs&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2F0gngs%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/87ccedb4383feb84a1e0f98c0f198513/href">https://medium.com/media/87ccedb4383feb84a1e0f98c0f198513/href</a></iframe><p>I hope you enjoyed this tutorial. If you want to see this in action, here is a landing page template where it’s implemented 👉 <a href="https://cruip.com/demos/evelyn/"><strong>Evelyn</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Er5XjwtIVb-CndG7M3hMCw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b2a25e8389e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cruip/how-to-build-a-pricing-slider-vue-8b2a25e8389e">How to build a pricing slider — Vue</a> was originally published in <a href="https://medium.com/cruip">Cruip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to build a pricing slider — React]]></title>
            <link>https://medium.com/cruip/how-to-build-a-pricing-slider-react-71545d81d63d?source=rss----15e394aa5deb---4</link>
            <guid isPermaLink="false">https://medium.com/p/71545d81d63d</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[pricing]]></category>
            <dc:creator><![CDATA[Pasquale Vitiello]]></dc:creator>
            <pubDate>Thu, 19 Mar 2020 14:39:20 GMT</pubDate>
            <atom:updated>2020-03-19T14:41:40.401Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to build a pricing slider — React</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*ao50Oac5xCXMwHleTo3R3Q@2x.png" /></figure><p>In this tutorial, I am going to build a <strong>pricing component in React</strong> using the HTML structure from the <a href="https://medium.com/cruip/how-to-build-a-pricing-slider-html-vanilla-js-c233b40751e2">previous article of this series</a>.</p><p>Let’s create a <strong>Pricing.js</strong> component file, and add the HTML into the return statement 👇</p><pre>import React from &quot;react&quot;;</pre><pre>class Pricing extends React.Component {<br>  render() {<br>    return (<br>      &lt;div className=&quot;pricing&quot;&gt;<br>        &lt;div className=&quot;pricing-slider center-content&quot;&gt;<br>          &lt;label className=&quot;form-slider&quot;&gt;<br>            &lt;span&gt;How many users do you have?&lt;/span&gt;<br>            &lt;input type=&quot;range&quot; /&gt;<br>          &lt;/label&gt;<br>          &lt;div className=&quot;pricing-slider-value&quot;&gt;<br>            {/* Current slider value */}<br>          &lt;/div&gt;<br>        &lt;/div&gt;</pre><pre>        &lt;div className=&quot;pricing-items&quot;&gt;<br>          &lt;div className=&quot;pricing-item&quot;&gt;<br>            &lt;div className=&quot;pricing-item-inner&quot;&gt;<br>              &lt;div className=&quot;pricing-item-content&quot;&gt;<br>                &lt;div className=&quot;pricing-item-header center-content&quot;&gt;<br>                  &lt;div class=&quot;pricing-item-title&quot;&gt;Basic&lt;/div&gt;<br>                  &lt;div className=&quot;pricing-item-price&quot;&gt;<br>                    &lt;span className=&quot;pricing-item-price-currency&quot; /&gt;<br>                    &lt;span className=&quot;pricing-item-price-amount&quot;&gt;Free&lt;/span&gt;<br>                  &lt;/div&gt;<br>                &lt;/div&gt;<br>                &lt;div className=&quot;pricing-item-features&quot;&gt;<br>                  &lt;ul className=&quot;pricing-item-features-list&quot;&gt;<br>                    &lt;li className=&quot;is-checked&quot;&gt;Excepteur sint occaecat&lt;/li&gt;<br>                    &lt;li className=&quot;is-checked&quot;&gt;Excepteur sint occaecat&lt;/li&gt;<br>                    &lt;li className=&quot;is-checked&quot;&gt;Excepteur sint occaecat&lt;/li&gt;<br>                    &lt;li&gt;Excepteur sint occaecat&lt;/li&gt;<br>                    &lt;li&gt;Excepteur sint occaecat&lt;/li&gt;<br>                  &lt;/ul&gt;<br>                &lt;/div&gt;<br>              &lt;/div&gt;<br>              &lt;div class=&quot;pricing-item-cta&quot;&gt;<br>                &lt;a class=&quot;button&quot; href=&quot;http://cruip.com/&quot;&gt;<br>                  Buy Now<br>                &lt;/a&gt;<br>              &lt;/div&gt;<br>            &lt;/div&gt;<br>          &lt;/div&gt;</pre><pre>          &lt;div className=&quot;pricing-item&quot;&gt;<br>            &lt;div className=&quot;pricing-item-inner&quot;&gt;<br>              &lt;div className=&quot;pricing-item-content&quot;&gt;<br>                &lt;div className=&quot;pricing-item-header center-content&quot;&gt;<br>                  &lt;div class=&quot;pricing-item-title&quot;&gt;Advanced&lt;/div&gt;<br>                  &lt;div className=&quot;pricing-item-price&quot;&gt;<br>                    &lt;span className=&quot;pricing-item-price-currency&quot;&gt;$&lt;/span&gt;<br>                    &lt;span className=&quot;pricing-item-price-amount&quot;&gt;13&lt;/span&gt;<br>                    /m<br>                  &lt;/div&gt;<br>                &lt;/div&gt;<br>                &lt;div className=&quot;pricing-item-features&quot;&gt;<br>                  &lt;ul className=&quot;pricing-item-features-list&quot;&gt;<br>                    &lt;li className=&quot;is-checked&quot;&gt;Excepteur sint occaecat&lt;/li&gt;<br>                    &lt;li className=&quot;is-checked&quot;&gt;Excepteur sint occaecat&lt;/li&gt;<br>                    &lt;li className=&quot;is-checked&quot;&gt;Excepteur sint occaecat&lt;/li&gt;<br>                    &lt;li className=&quot;is-checked&quot;&gt;Excepteur sint occaecat&lt;/li&gt;<br>                    &lt;li className=&quot;is-checked&quot;&gt;Excepteur sint occaecat&lt;/li&gt;<br>                  &lt;/ul&gt;<br>                &lt;/div&gt;<br>              &lt;/div&gt;<br>              &lt;div class=&quot;pricing-item-cta&quot;&gt;<br>                &lt;a class=&quot;button&quot; href=&quot;http://cruip.com/&quot;&gt;<br>                  Buy Now<br>                &lt;/a&gt;<br>              &lt;/div&gt;<br>            &lt;/div&gt;<br>          &lt;/div&gt;<br>        &lt;/div&gt;<br>      &lt;/div&gt;<br>    );<br>  }<br>}</pre><pre>export default Pricing;</pre><h3>Shaping input and output data</h3><p>We already have a <strong>data scheme</strong> with <em>input</em> and <em>output</em> values (check out the <a href="https://medium.com/cruip/how-to-build-a-pricing-slider-html-vanilla-js-c233b40751e2#9426">first article</a> of this series to know more).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Eu-9GRIzSK8GcIywvawQRQ.png" /></figure><p>We will use the state object to contain that data.</p><h3>Defining the component state</h3><p>React has a built-in state object where to store property values that belongs to the component. I will use that to set <em>input range</em> and <em>data scheme</em> values.</p><pre>state = {<br>  priceInputValue: &quot;0&quot;, // initial input value<br>  priceInput: {         // slider values<br>    0: &quot;1,000&quot;,<br>    1: &quot;1,250&quot;,<br>    2: &quot;1,500&quot;,<br>    3: &quot;2,000&quot;,<br>    4: &quot;2,500&quot;,<br>    5: &quot;3,500&quot;,<br>    6: &quot;6,000&quot;,<br>    7: &quot;15,000&quot;,<br>    8: &quot;50,000&quot;,<br>    9: &quot;50,000+&quot;<br>  },<br>  priceOutput: {        // output values<br>    plan1: {<br>      0: [&quot;&quot;, &quot;Free&quot;, &quot;&quot;],<br>      1: [&quot;$&quot;, &quot;13&quot;, &quot;/m&quot;],<br>      2: [&quot;$&quot;, &quot;17&quot;, &quot;/m&quot;],<br>      3: [&quot;$&quot;, &quot;21&quot;, &quot;/m&quot;],<br>      4: [&quot;$&quot;, &quot;25&quot;, &quot;/m&quot;],<br>      5: [&quot;$&quot;, &quot;42&quot;, &quot;/m&quot;],<br>      6: [&quot;$&quot;, &quot;58&quot;, &quot;/m&quot;],<br>      7: [&quot;$&quot;, &quot;117&quot;, &quot;/m&quot;],<br>      8: [&quot;$&quot;, &quot;208&quot;, &quot;/m&quot;],<br>      9: [&quot;&quot;, &quot;Contact Us&quot;, &quot;&quot;]<br>    }<br>  }<br>};</pre><p>Now pass the priceInputValue to the input range defaultValue attribute:</p><pre>&lt;input type=&quot;range&quot; defaultValue={this.state.priceInputValue} /&gt;</pre><h3>Setting range slider attributes</h3><p>Create a ref and attach it to the <strong>input range element</strong></p><pre>// Create ref<br>slider = React.createRef();<br>// Attach ref<br>&lt;input<br>  type=&quot;range&quot;<br>  defaultValue={this.state.priceInputValue}<br>  ref={this.slider} /&gt;</pre><p>Let’s set the range slider min, max attributes, right after the component output has been rendered to the DOM 👇</p><pre>componentDidMount() {<br>  this.slider.current.setAttribute(&quot;min&quot;, 0);<br>  this.slider.current.setAttribute(<br>    &quot;max&quot;,<br>    Object.keys(this.state.priceInput).length - 1<br>  );<br>}</pre><p>We have now a range slider whose values go from 0 to 9! 🙌</p><p>Here is a recap of what we have built so far:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2Fj7w4k&amp;display_name=CodeSandbox&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2Fj7w4k&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2Fj7w4k%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/f7a66cbf2ec432f1122d7304abba9454/href">https://medium.com/media/f7a66cbf2ec432f1122d7304abba9454/href</a></iframe><h3>Binding input and output data</h3><p>We have a working range slider, but it is still disconnected from the visualized price.</p><p>Before anything else, we need to <strong>update the </strong><strong>priceInputValue property value</strong> every time a user interacts with the slider. To do that, let&#39;s create a method ...</p><pre>handlePricingSlide = e =&gt; {<br>  this.setState({ priceInputValue: e.target.value });<br>};</pre><p>… to be invoked when the input onChange event occurs.</p><pre>&lt;input<br>  type=&quot;range&quot;<br>  ref={this.slider}<br>  defaultValue={this.state.priceInputValue}<br>  onChange={this.handlePricingSlide}<br>/&gt;</pre><p>OK, now we need another method to <strong>retrieve the data to be outputted</strong>, accordingly with the current input value</p><pre>getPricingData = (obj, pos) =&gt; {<br>  return set !== undefined<br>    ? obj[this.state.priceInputValue][pos]<br>    : obj[this.state.priceInputValue];<br>};</pre><p>This method has two parameters:</p><ul><li>obj - The input or output object we want to retrieve data from</li><li>pos (optional) - The position of a required element in the array, if there is any. It is required for the <em>plan</em> objects, since to each key corresponds an array of values (e.g. 0: [&quot;&quot;, &quot;Free&quot;, &quot;&quot;], ...).</li></ul><p>So, to output the <strong>current slider value</strong>, we will call the method like this 👇</p><pre>&lt;div className=&quot;pricing-slider-value&quot;&gt;<br>  {this.getPricingData(this.state.priceInput)}<br>&lt;/div&gt;</pre><p>And here is how to output the <strong>price data</strong> instead 👇</p><pre>&lt;div className=&quot;pricing-item-price&quot;&gt;<br>  &lt;span className=&quot;pricing-item-price-currency&quot;&gt;<br>    {this.getPricingData(this.state.priceOutput.plan1, 0)}<br>  &lt;/span&gt;<br>  &lt;span className=&quot;pricing-item-price-amount&quot;&gt;<br>    {this.getPricingData(this.state.priceOutput.plan1, 1)}<br>  &lt;/span&gt;<br>  {this.getPricingData(this.state.priceOutput.plan1, 2)}<br>&lt;/div&gt;</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2Ftp1fv&amp;display_name=CodeSandbox&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2Ftp1fv&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2Ftp1fv%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/830fdd8417616216931a50f86d544e2a/href">https://medium.com/media/830fdd8417616216931a50f86d544e2a/href</a></iframe><h3>Adjusting the slider value element position</h3><p>Almost there. 🏁 We want the slider value to be following the slider thumb.</p><p>We need a new method for that but, before proceeding, there is another DOM element that needs to be referenced.</p><p>Create a ref and pass it to the <strong>current slider value</strong></p><pre>// Create ref<br>sliderValue = React.createRef();<br>// Attach ref<br>&lt;div className=&quot;pricing-slider-value&quot; ref={this.sliderValue}&gt;</pre><p>Get the slider thumb size from a CSS property 👍</p><pre>this.thumbSize = parseInt(<br>  window<br>    .getComputedStyle(this.sliderValue.current)<br>    .getPropertyValue(&quot;--thumb-size&quot;),<br>  10<br>);</pre><p>Now that we have a reference for the .pricing-slider-value element, we can create the method.</p><pre>handleSliderValuePosition = input =&gt; {<br>  const multiplier = input.value / input.max;<br>  const thumbOffset = this.thumbSize * multiplier;<br>  const priceInputOffset =<br>    (this.thumbSize - this.sliderValue.current.clientWidth) / 2;<br>  this.sliderValue.current.style.left =<br>    input.clientWidth * multiplier - thumbOffset + priceInputOffset + &quot;px&quot;;<br>};</pre><p>Here is a visual representation of what the method does 👇</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UK7RfohR_Vh0kYBlEBVW5w.png" /></figure><p>Call the method as soon as the component has rendered …</p><pre>componentDidMount() {<br>  this.handleSliderValuePosition(this.slider.current);<br>}</pre><p>… and every time the input range value changes:</p><pre>handlePricingSlide = e =&gt; {<br>  this.handleSliderValuePosition(e.target);<br>};</pre><h3>Conclusion</h3><p>Here is the final result. Click on <em>Open Sandbox</em> to see the full code.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2Fymcw6&amp;display_name=CodeSandbox&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2Fymcw6&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2Fymcw6%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/3501513d4a97ccfc0043072458c78e61/href">https://medium.com/media/3501513d4a97ccfc0043072458c78e61/href</a></iframe><p>I hope you enjoyed this tutorial. If you want to see this in action here is a landing page template where it’s implemented 👉 <a href="https://cruip.com/demos/storm/"><strong>Storm</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*999v4mzTDRCMLVeTdgI1Hg.png" /></figure><p><em>Originally published at </em><a href="https://dev.to/cruip/how-to-build-a-pricing-slider-in-react-59cc"><em>https://dev.to</em></a><em> on March 19, 2020.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71545d81d63d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cruip/how-to-build-a-pricing-slider-react-71545d81d63d">How to build a pricing slider — React</a> was originally published in <a href="https://medium.com/cruip">Cruip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to build a pricing slider — HTML & Vanilla JS]]></title>
            <link>https://medium.com/cruip/how-to-build-a-pricing-slider-html-vanilla-js-c233b40751e2?source=rss----15e394aa5deb---4</link>
            <guid isPermaLink="false">https://medium.com/p/c233b40751e2</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[pricing]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Pasquale Vitiello]]></dc:creator>
            <pubDate>Mon, 16 Mar 2020 17:16:46 GMT</pubDate>
            <atom:updated>2020-03-19T14:44:17.732Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to build a pricing slider — HTML &amp; Vanilla JS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*iSauguHdNlMJH0-yq8Faxg@2x.png" /></figure><p>If you are selling <em>pay as you go</em> or <em>subscription</em> plans, there might be chances that you need a landing page with a pricing table controlled by a <a href="https://www.w3schools.com/howto/howto_js_rangeslider.asp">range slider</a> — just like in the example below 👇</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2F55sxn&amp;display_name=CodeSandbox&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2F55sxn&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2F55sxn%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/66dda8b8584d4ddcf66408c1790ce074/href">https://medium.com/media/66dda8b8584d4ddcf66408c1790ce074/href</a></iframe><p>Let’s start with the <strong>HTML and JavaScript</strong> version, then we will cover React and Vue ones in the next articles!</p><h3>Creating the HTML structure</h3><p>I’ve created a very basic HTML structure, with some ready-made CSS from the <a href="https://dev.to/cruip/5-reasons-why-i-built-a-css-framework-and-what-i-ve-learned-5cb2">Cruip framework</a>.</p><pre>&lt;div class=&quot;pricing&quot;&gt;</pre><pre>    &lt;div class=&quot;pricing-slider&quot;&gt;<br>        &lt;label class=&quot;form-slider&quot;&gt;<br>            &lt;span&gt;How many users do you have?&lt;/span&gt;<br>            &lt;input type=&quot;range&quot; /&gt;<br>        &lt;/label&gt;<br>        &lt;div class=&quot;pricing-slider-value&quot;&gt;&lt;/div&gt;<br>    &lt;/div&gt;</pre><pre>    &lt;div class=&quot;pricing-items&quot;&gt;<br>        &lt;div class=&quot;pricing-item&quot;&gt;<br>            &lt;div class=&quot;pricing-item-inner&quot;&gt;<br>                &lt;div class=&quot;pricing-item-content&quot;&gt;<br>                    &lt;div class=&quot;pricing-item-header&quot;&gt;<br>                        &lt;div class=&quot;pricing-item-title&quot;&gt;Basic&lt;/div&gt;<br>                        &lt;div class=&quot;pricing-item-price&quot;&gt;<br>                            &lt;span class=&quot;pricing-item-price-currency&quot;&gt;$&lt;/span&gt;<br>                            &lt;span class=&quot;pricing-item-price-amount&quot;&gt;13&lt;/span&gt;<br>                            &lt;span class=&quot;pricing-item-price-after&quot;&gt;/m&lt;/span&gt;<br>                        &lt;/div&gt;<br>                    &lt;/div&gt;<br>                    &lt;div class=&quot;pricing-item-features&quot;&gt;<br>                        &lt;ul class=&quot;pricing-item-features-list&quot;&gt;<br>                            &lt;li class=&quot;is-checked&quot;&gt;Excepteur sint occaecat&lt;/li&gt;<br>                            &lt;li class=&quot;is-checked&quot;&gt;Excepteur sint occaecat&lt;/li&gt;<br>                            &lt;li class=&quot;is-checked&quot;&gt;Excepteur sint occaecat&lt;/li&gt;<br>                            &lt;li&gt;Excepteur sint occaecat&lt;/li&gt;<br>                            &lt;li&gt;Excepteur sint occaecat&lt;/li&gt;<br>                        &lt;/ul&gt;<br>                    &lt;/div&gt;<br>                &lt;/div&gt;<br>                &lt;div class=&quot;pricing-item-cta&quot;&gt;<br>                    &lt;a class=&quot;button&quot; href=&quot;#&quot;&gt;Buy Now&lt;/a&gt;<br>                &lt;/div&gt;<br>            &lt;/div&gt;<br>        &lt;/div&gt;<br>    &lt;/div&gt;<br>&lt;/div&gt;</pre><p>Notice that we have <strong>input</strong> ⬇️ and <strong>output</strong> ⬆️ elements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TbCGe6WqtZbr0Q-fiBXelQ.png" /></figure><h4>Input elements</h4><ul><li>The &lt;input type=&quot;range&quot; /&gt; element, i.e. the slider control</li><li>The &lt;div class=&quot;pricing-slider-value&quot;&gt; element, into which we will write the current slider value</li></ul><h4>Output elements</h4><p>We can have multiple pricing tabs, which means multiple outputs. Each output consists of a &lt;div class=&quot;pricing-item-price&quot;&gt; element, that contains 3 more elements:</p><ul><li>&lt;span class=&quot;pricing-item-price-currency&quot;&gt; for the currency sign</li><li>&lt;span class=&quot;pricing-item-price-amount&quot;&gt; for the amount</li><li>&lt;span class=&quot;pricing-item-price-after&quot;&gt; for any other information, such as the billing period</li></ul><p>And here is the result 👇</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2Ff3bxf&amp;display_name=CodeSandbox&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2Ff3bxf&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2Ff3bxf%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/531a08ec623bfeb092963808ecce2651/href">https://medium.com/media/531a08ec623bfeb092963808ecce2651/href</a></iframe><h3>Shaping input and output data</h3><p>We need to design our <strong>data scheme</strong> now. I’ve defined a range of slider values (<em>input</em>) and the corresponding price values (<em>output</em>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-CzI68Ig7Sc_lTXhvwY30g.png" /></figure><p>Go on adding <strong>input</strong> and <strong>output</strong> data to HTML via data attributes.</p><p>Input data 👇</p><pre>&lt;input<br>  type=&quot;range&quot;<br>  data-price-input=&#39;{<br>      &quot;0&quot;: &quot;1,000&quot;,<br>      &quot;1&quot;: &quot;1,250&quot;,<br>      &quot;2&quot;: &quot;1,500&quot;,<br>      &quot;3&quot;: &quot;2,000&quot;,<br>      &quot;4&quot;: &quot;2,500&quot;,<br>      &quot;5&quot;: &quot;3,500&quot;,<br>      &quot;6&quot;: &quot;6,000&quot;,<br>      &quot;7&quot;: &quot;15,000&quot;,<br>      &quot;8&quot;: &quot;50,000&quot;,<br>      &quot;9&quot;: &quot;50,000+&quot;                        <br>    }&#39;<br>/&gt;</pre><p>Output data looks a little different for structure, since each value is not a string, but an array of strings.</p><pre>&lt;div<br>  class=&quot;pricing-item-price&quot;<br>  data-price-output=&#39;{<br>    &quot;0&quot;: [&quot;&quot;, &quot;Free&quot;, &quot;&quot;],<br>    &quot;1&quot;: [&quot;$&quot;, &quot;13&quot;, &quot;/m&quot;],<br>    &quot;2&quot;: [&quot;$&quot;, &quot;17&quot;, &quot;/m&quot;],<br>    &quot;3&quot;: [&quot;$&quot;, &quot;21&quot;, &quot;/m&quot;],<br>    &quot;4&quot;: [&quot;$&quot;, &quot;25&quot;, &quot;/m&quot;],<br>    &quot;5&quot;: [&quot;$&quot;, &quot;42&quot;, &quot;/m&quot;],<br>    &quot;6&quot;: [&quot;$&quot;, &quot;58&quot;, &quot;/m&quot;],<br>    &quot;7&quot;: [&quot;$&quot;, &quot;117&quot;, &quot;/m&quot;],<br>    &quot;8&quot;: [&quot;$&quot;, &quot;208&quot;, &quot;/m&quot;],<br>    &quot;9&quot;: [&quot;&quot;, &quot;Contact us&quot;, &quot;&quot;]<br>  }&#39;<br>&gt;</pre><h3>Defining JavaScript variables</h3><p>Since we might want to display more than one pricing slider on a page, let’s collect all elements having pricing-slider as a class, and loop through them.</p><pre>const pricingSliders = document.querySelectorAll(&quot;.pricing-slider&quot;);</pre><pre>if (pricingSliders.length &gt; 0) {<br>  for (let i = 0; i &lt; pricingSliders.length; i++) {<br>    const pricingSlider = pricingSliders[i];<br>  }<br>}</pre><p>Now that we have our pricing slider defined by a constant, we can move forward with <strong>storing elements and data</strong>, for both <em>input</em> and <em>output</em>.</p><p>To do that, we are going to create:</p><ul><li>a pricingInput object that contains stuff dealing with the range slider (the <em>input</em>)</li><li>a pricingOutput variable, that contains <em>output</em> elements and data. It&#39;s an array because, as previously said, we might have more than one <em>output</em> 😉</li></ul><pre>if (pricingSliders.length &gt; 0) {<br>  for (let i = 0; i &lt; pricingSliders.length; i++) {<br>    const pricingSlider = pricingSliders[i];</pre><pre>    // Build the input object<br>    const pricingInput = {<br>      el: pricingSlider.querySelector(&quot;input&quot;)<br>    };<br>    pricingInput.data = JSON.parse(<br>      pricingInput.el.getAttribute(&quot;data-price-input&quot;)<br>    );<br>    pricingInput.currentValEl = pricingSlider.querySelector(<br>      &quot;.pricing-slider-value&quot;<br>    );<br>    pricingInput.thumbSize = parseInt(<br>      window<br>        .getComputedStyle(pricingInput.currentValEl)<br>        .getPropertyValue(&quot;--thumb-size&quot;),<br>      10<br>    );</pre><pre>    // Build the output array<br>    const pricingOutputEls = pricingSlider.parentNode.querySelectorAll(<br>      &quot;.pricing-item-price&quot;<br>    );<br>    const pricingOutput = [];<br>    for (let i = 0; i &lt; pricingOutputEls.length; i++) {<br>      const pricingOutputEl = pricingOutputEls[i];<br>      const pricingOutputObj = {};<br>      pricingOutputObj.currency = pricingOutputEl.querySelector(<br>        &quot;.pricing-item-price-currency&quot;<br>      );<br>      pricingOutputObj.amount = pricingOutputEl.querySelector(<br>        &quot;.pricing-item-price-amount&quot;<br>      );<br>      pricingOutputObj.after = pricingOutputEl.querySelector(<br>        &quot;.pricing-item-price-after&quot;<br>      );<br>      pricingOutputObj.data = JSON.parse(<br>        pricingOutputEl.getAttribute(&quot;data-price-output&quot;)<br>      );<br>      pricingOutput.push(pricingOutputObj);<br>    }<br>  }<br>}</pre><p>Let’s see what’s inside these objects 📦</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o_saJe47izMyBht8yUSIjw.png" /></figure><h3>Setting range slider attributes</h3><p>Now we can proceed with setting the range slider min, max, and value attributes.</p><pre>if (pricingSliders.length &gt; 0) {<br>  for (let i = 0; i &lt; pricingSliders.length; i++) {<br>    const pricingSlider = pricingSliders[i];</pre><pre>    // [ ... previously defined variables ... ]</pre><pre>    // set input range min attribute (0)<br>    pricingInputEl.setAttribute(&quot;min&quot;, 0);<br>    // set input range max attribute (9, i.e. the number of values)<br>    pricingInputEl.setAttribute(&quot;max&quot;, Object.keys(priceInput).length - 1);<br>    // initial slider value (0, or any other value if assigned via HTML)<br>    !pricingInputEl.getAttribute(&quot;value&quot;) &amp;&amp;<br>      pricingInputEl.setAttribute(&quot;value&quot;, 0);<br>  }<br>}</pre><p>Great! We have a range slider whose values go from 0 to 9 🙌</p><p>The next step is outputting the <strong>slider value</strong> (e.g. 1,000) that corresponds to the <strong>current range value</strong> (e.g. 0), into the &lt;div class=&quot;pricing-slider-value&quot;&gt; element.</p><p>To do that, we need to create a function to be invoked every time a user interacts with the slide. As obvious, we need to pass our input and output objects as arguments</p><pre>function handlePricingSlide(input, output) {<br>  // output the current slider value<br>  if (input.currentValEl)<br>    input.currentValEl.innerHTML = input.data[input.el.value];<br>}</pre><p>Let’s call the function 📢</p><pre>if (pricingSliders.length &gt; 0) {<br>  for (let i = 0; i &lt; pricingSliders.length; i++) {<br>    const pricingSlider = pricingSliders[i];</pre><pre>    // [ ... previously defined variables ... ]<br>    // [ ... previous range slider attributes assignment ... ]</pre><pre>    handlePricingSlider(pricingInput, pricingOutput);<br>    window.addEventListener(&quot;input&quot;, function() {<br>      handlePricingSlider(pricingInput, pricingOutput);<br>    });<br>  }<br>}</pre><p>And here is the result 👇</p><p><a href="https://codesandbox.io/s/html-pricing-slider-2-jdyv2?fontsize=14&amp;hidenavigation=1&amp;theme=dark">HTML Pricing Slider - #2 - CodeSandbox</a></p><h3>Binding input and output data with JavaScript</h3><p>We have a working range slider, but it is still disconnected from the visualized price. It’s time to bind <strong>input slider values</strong> with <strong>output price data</strong>.</p><pre>function handlePricingSlide(input, output) {<br>  // output the current slider value<br>  if (input.currentValEl)<br>    input.currentValEl.innerHTML = input.data[input.el.value];<br>  // update prices<br>  for (let i = 0; i &lt; output.length; i++) {<br>    const outputObj = output[i];<br>    if (outputObj.currency) outputObj.currency.innerHTML = outputObj.data[input.el.value][0];<br>    if (outputObj.amount) outputObj.amount.innerHTML = outputObj.data[input.el.value][1];<br>    if (outputObj.after) outputObj.after.innerHTML = outputObj.data[input.el.value][2];<br>  }<br>}</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2Fmngiy&amp;display_name=CodeSandbox&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2Fmngiy&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2Fmngiy%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/7551ab17d246b4e90de0e9a4be0da4ce/href">https://medium.com/media/7551ab17d246b4e90de0e9a4be0da4ce/href</a></iframe><h3>Adjusting the slider value element position</h3><p>Almost there. 🏁 We want the slider value to be following the slider thumb.</p><p>Let’s create a function calculating the left value to be applied to the slider value element.</p><pre>function handleSliderValuePosition(input) {<br>  const multiplier = input.el.value / input.el.max;<br>  const thumbOffset = input.thumbSize * multiplier;<br>  const priceInputOffset =<br>    (input.thumbSize - input.currentValEl.clientWidth) / 2;<br>  input.currentValEl.style.left =<br>    input.el.clientWidth * multiplier - thumbOffset + priceInputOffset + &quot;px&quot;;<br>}</pre><p>The function determines the proper slider value position, so that the element is horizontally aligned with the slider thumb. Here is a visual representation of what the function does 👇</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pc32LSG9Blusor09QYXCKg.png" /></figure><p>Notice that the thumb size value is parsed with the getComputedStyle() method (see the paragraph where we defined the JS variables). That way I can change the thumb size in the CSS, without having to change anything in my JavaScript file.</p><h3>Setting a default slider value</h3><p>In case you want to set an initial slider value other than Free, you just need to add a value=&quot;n&quot; attribute to the range slider.</p><p>For example, &lt;input type=&quot;range&quot; value=&quot;1&quot; /&gt; will return a range slider with 1,000 as initial slider value.</p><h3>Conclusions</h3><p>Here is the final result again. Click on <em>Open Sandbox</em> to see the full code.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2F55sxn&amp;display_name=CodeSandbox&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2F55sxn&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2F55sxn%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3a945a3fa79dfd9143c88e96dd90123/href">https://medium.com/media/c3a945a3fa79dfd9143c88e96dd90123/href</a></iframe><p>I hope you enjoyed this tutorial. If you want to see this in action here is a landing page template where it’s implemented 👉 <a href="https://cruip.com/demos/surface/"><strong>Surface</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hZBxXFUVhUPPx3v-AWFuoQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c233b40751e2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cruip/how-to-build-a-pricing-slider-html-vanilla-js-c233b40751e2">How to build a pricing slider — HTML &amp; Vanilla JS</a> was originally published in <a href="https://medium.com/cruip">Cruip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[30 amazing landing page examples for your personal inspiration in 2019]]></title>
            <link>https://medium.com/cruip/20-amazing-landing-page-examples-for-your-personal-inspiration-in-2019-f0698fb21e91?source=rss----15e394aa5deb---4</link>
            <guid isPermaLink="false">https://medium.com/p/f0698fb21e91</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[inspiration]]></category>
            <category><![CDATA[landing-page-design]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[design-inspiration]]></category>
            <dc:creator><![CDATA[Davide Pacilio]]></dc:creator>
            <pubDate>Tue, 16 Apr 2019 09:14:06 GMT</pubDate>
            <atom:updated>2020-01-15T19:12:35.448Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9KslGr3VaSbqNMjCA7Wexg.png" /></figure><p><em>Last Updated on August 8, 2019</em></p><p>At <a href="https://cruip.com/">Cruip.com</a> we’re obsessed with the latest trends and best practices to create every new template for our product! We spend hours researching and analyzing the best landing pages, so we would like to share the ones we love the most with all you.</p><p>We hope these inspirations will help you save time (so you can invest it in improving your business), and build better landing pages for your product!</p><p>Didn’t you know about <a href="https://cruip.com/">Cruip</a>? Check it out<em> 👇</em></p><p><a href="https://cruip.com/">HTML, Vue.js and React templates for startup landing pages - Cruip</a></p><p><em>For each example, we’ve highlighted 3 things we liked the most about the design, so you can get some ideas of what to include (or improve) on your landing page.</em></p><h3>30 amazing landing page examples in 2019</h3><h3>1) OLMO</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*JjXd_btZOt1GXAp6oGLGJw@2x.png" /></figure><p><strong>Product: </strong><a href="https://olmo.io/">https://olmo.io/</a></p><p><strong>Product details:</strong></p><p>The first personalized networking concierge dedicated to connecting you to the right people.</p><p><strong>3 things we like about it:</strong></p><ul><li>Strong and unique visual identity</li><li>The pleasant color palette, bold typography choice, and design in general</li><li>The balance between illustrations and application screenshots describe what the product does in a clear and creative way</li></ul><h3>2) PixelSnap 2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*jTqa3lhAlHRjphV7AsHuYg@2x.png" /></figure><p><strong>Product: </strong><a href="https://getpixelsnap.com/">https://getpixelsnap.com/</a></p><p><strong>Product details:</strong></p><p>The fastest tool for measuring anything on your screen.</p><p><strong>3 things we like about it:</strong></p><ul><li>The superb variety of illustrations/animations. I would buy this product without even reading the copy</li><li>PixelSnap makes a great job by explaining all key features in a clear and attractive way</li><li>The content hierarchy is perfectly balanced to sell digital products</li></ul><h3>3) Sendiblue</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*cZZLiG2SkuIj1WhkB8FcJw@2x.png" /></figure><p><strong>Product: </strong><a href="https://www.sendinblue.com/">https://www.sendinblue.com/</a></p><p><strong>Product details:</strong></p><p>All-in-one sales &amp; marketing toolbox.</p><p><strong>3 things we like about it:</strong></p><ul><li>The overall look and feel is top-notch for a sales and marketing product</li><li>The balance between animated illustrations and imagery makes the user excited to keep scrolling the page</li><li>The sharp color palette, and typography choice</li></ul><h3>4) Calibra</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*XvxSNdMRtXPmd-IlhBdkig@2x.png" /></figure><p><strong>Product: </strong><a href="https://calibra.com/">https://calibra.com</a></p><p><strong>Product details:</strong></p><p>A connected wallet designed for Libra, a new cryptocurrency from Facebook.</p><p><strong>3 things we like about it:</strong></p><ul><li>The primary color (the purple) is very impactful</li><li>The reveal animations make the page very nice and dynamic</li><li>The landing page is very friendly and accessible (especially for the color palette, and the presence of human pictures)</li></ul><h3>5) VideoAsk</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*CwRZI-xKRKpXXfZ31G5PPw@2x.png" /></figure><p><strong>Product: </strong><a href="https://www.videoask.it/">https://www.videoask.it/</a></p><p><strong>Product details:</strong></p><p>Get Face2Face with your audience in a ridiculously simple &amp; fast way.</p><p><strong>3 things we like about it:</strong></p><ul><li>The lovely purple/green color combination</li><li>The choice of using animated product screenshots to explain app features and functionalities</li><li>You can truly understand what VideoAsk does without even checking <em>the how it works</em> page.</li></ul><h3>6) Linear</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*4T4Ngmh0AOysKZOeyRcImQ@2x.png" /></figure><p><strong>Product: </strong><a href="https://linear.app/">https://linear.app/</a></p><p><strong>Product details:</strong></p><p>The issue tracking tool that lets you manage software development and track bugs.</p><p><strong>3 things we like about it:</strong></p><ul><li>The dark skin makes this product very sleek and attractive</li><li>The decision of using product screenshots give me a clear of what the product does</li><li>The content hierarchy makes this landing page perfect to capture early adopters</li></ul><h3>7) revealbot</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*0AFJk6VczEz9vexU1j-ygQ@2x.png" /></figure><p><strong>Product: </strong><a href="https://revealbot.com/">https://revealbot.com/</a></p><p><strong>Product details:</strong></p><p>Automate all your ad management strategies for Facebook and Google Ads in a single interface.</p><p><strong>3 things we like about it:</strong></p><ul><li>The visual identity is very nice, friendly and unique</li><li>All contents have been organized very well across the page (what the product does, features, benefits, etc..)</li><li>The presence of previous results and customer testimonials make this product trustworthy</li></ul><h3>8) Rollie</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*F9pA-XrFTQTtAAh4X94LlA@2x.png" /></figure><p><strong>Product: </strong><a href="https://rollie.co/">https://rollie.co/</a></p><p><strong>Product details:</strong></p><p>The simpler way to check your spending and balances.</p><p><strong>3 things we like about it:</strong></p><ul><li>Simple and brandable design</li><li>The presence of application screenshots make me curious about the product</li><li>The landing page doesn’t overwhelm the user with tons of useless information</li></ul><h3>9) DAML</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*XUbaEICIgqsNO5NddJ9j7g@2x.png" /></figure><p><strong>Product: </strong><a href="https://daml.com/">https://daml.com/</a></p><p><strong>Product details:</strong></p><p>An open-source smart contract language for building future-proof distributed applications on a safe, privacy-aware runtime.</p><p><strong>3 things we like about it:</strong></p><ul><li>Strong visual identity</li><li>All contents have been defined and organized very well across the page (what the product does, features, benefits, etc..)</li><li>The illustrations are well designed and they don’t distract visitors from focusing on the key information</li></ul><h3>10) Mutify</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*Qspw3jJvujvDo8WCgk2ALg@2x.png" /></figure><p><strong>Product: </strong><a href="https://mutify.app/">https://mutify.app/</a></p><p><strong>Product details:</strong></p><p>Use a shortcut or the touch bar on any Mac device to quickly mute your microphone.</p><p><strong>3 things we like about it:</strong></p><ul><li>The visual part is impactful, extremely brandable and unique</li><li>The app features have been explained in a simple and clear way for the user</li><li>Images and animations make me want to buy the app straight away</li></ul><h3>11) Marvel (user testing)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*romAzbq7aolXRSRO2oIYrw@2x.png" /></figure><p><strong>Product: </strong><a href="https://marvelapp.com/user-testing/">https://marvelapp.com/user-testing/</a></p><p><strong>Product details:</strong></p><p>Get video, voice and analytical feedback on designs and prototypes in just a few clicks.</p><p><strong>3 things we like about it:</strong></p><ul><li>Impeccable design and content hierarchy</li><li>You can clearly understand what this product does without scrolling below the hero</li><li>The body part is features-benefits oriented and organized into bite-size chunks for easy reading.</li></ul><h3>12) Shuttle</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*OOeIjmF1DOYD-S9Fv__fHw@2x.png" /></figure><p><strong>Product: </strong><a href="https://getshuttle.co/">https://getshuttle.co/</a></p><p><strong>Product details:</strong></p><p>A simple and new way to archive and manage your files online.</p><p><strong>3 things we like about it:</strong></p><ul><li>The friendly color palette, typography choice, and design in general</li><li>The decision of using animated product screenshots is worth a thousand words</li><li>The content hierarchy makes this landing page perfect to capture early adopters</li></ul><h3>13) Mollie</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*88Z_0YYpMsN0xRc2mtWxMg@2x.png" /></figure><p><strong>Product: </strong><a href="https://www.mollie.com/en/">https://www.mollie.com/en/</a></p><p><strong>Product details:</strong></p><p>Accept payments on your website or in your app.</p><p><strong>3 things we like about it:</strong></p><ul><li>Minimal but very brandable design</li><li>Everything across the page is a visual representation of their value proposition (easy and effortless payments)</li><li>The perfect balance between illustrations and animations</li></ul><h3>14) Journal</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*v1RZa--ofsg5Wh4kSNNRww@2x.png" /></figure><p><strong>Product: </strong><a href="https://usejournal.com/">https://usejournal.com/</a></p><p><strong>Product details:</strong></p><p>Organize all your content and ideas together in one place.</p><p><strong>3 things we like about it:</strong></p><ul><li>The color palette reflects and reinforces their brand identity very well (Journal)</li><li>The choice of using product screenshots to explain app features and functionalities</li><li>The rich variety of product information across the page</li></ul><h3>15) Metomic</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*aAbm6rYPPrgEe9U2TgZTyw@2x.png" /></figure><p><strong>Product: </strong><a href="https://metomic.io/">https://metomic.io/</a></p><p><strong>Product details:</strong></p><p>A Privacy Automation Platform made to help businesses deliver transparent, trustworthy online experiences.</p><p><strong>3 things we like about it:</strong></p><ul><li>The design reminds me a little bit of Stripe, but with a pretty different look and feel</li><li>Illustrations and animations are well designed and self-explanatory for the user</li><li>Great use of typography and white space</li></ul><h3>16) Webflow Ecommerce</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*V7R3CzlJus9LqCOHvvVe6Q@2x.png" /></figure><p><strong>Product: </strong><a href="https://webflow.com/ecommerce">https://webflow.com/ecommerce</a></p><p><strong>Product details:</strong></p><p>Design, sell and scale your online business with the first e-commerce platform that gives you control over <em>everything</em>.</p><p><strong>3 things we like about it:</strong></p><ul><li>The overall look and feel reflects the Webflow identity (and we like that)</li><li>What makes Webflow Ecommerce stands out from the competition is emphasized (and repeated) across the page (total control and powerful customization options).</li><li>As above, the value proposition is displayed and repeated everywhere (make your eCommerce unique without writing a single line of code)</li></ul><h3>17) Pixelmator</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*rdU0uPTBLQ15ztEw9VwvMA@2x.png" /></figure><p><strong>Product: </strong><a href="https://www.pixelmator.com/mac/">https://www.pixelmator.com/mac/</a></p><p><strong>Product details:</strong></p><p>A powerful, fast, and easy-to-use image editor for Mac.</p><p><strong>3 things we like about it:</strong></p><ul><li>The design reminds me of Apple, and it’s a smart choice for a Mac app</li><li>App screenshots give visitors a clear idea of what they’ll get by downloading the app.</li><li>Contents and key information are organized very well across the page</li></ul><h3>18) BlueVine</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*KDtH62c_GcuFveo45gg_1g@2x.png" /></figure><p><strong>Product: </strong><a href="https://www.bluevine.com/">https://www.bluevine.com/</a></p><p><strong>Product details:</strong></p><p>Funding solutions tailored to your business needs.</p><p><strong>3 things we like about it:</strong></p><ul><li>The design is friendly and trustful (It’s a crucial factor for who provides access to capital and loans)</li><li>The presence of different customer testimonials strengthens the credibility of their offer.</li><li>The value proposition is very clear (Fast funding for your business)</li></ul><h3>19) HelpScout</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*k-ZC9FttGaSb8XuckZXlPw@2x.png" /></figure><p><strong>Product: </strong><a href="https://www.helpscout.com/">https://www.helpscout.com/</a></p><p><strong>Product details:</strong></p><p>HelpScouts provides email and lives chat right where your customers need it, all in one place.</p><p><strong>3 things we like about it:</strong></p><ul><li>Product features and benefits are well presented across the page</li><li>Honestly, we’re not a big fan of these kinds of trendy/fancy illustrations, but they represent a brand like HelpScout very well (simple and friendly customer service)</li><li>A lovely mix of illustrations and product screenshots</li></ul><h3>20) Dharma</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*0GpXtEPONX_dCWRQj4AAdA@2x.png" /></figure><p><strong>Product: </strong><a href="https://www.dharma.io/">https://www.dharma.io/</a></p><p><strong>Product details:</strong></p><p>Borrow and lend cryptocurrency.</p><p><strong>3 things we like about it:</strong></p><ul><li>The bold typography and the great use of white space</li><li>The presence of dynamic illustrations immediately communicate the benefits of using the product.</li><li>The bright color scheme pops on this page’s background.</li></ul><h3>21) Revolut Metal</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*GTxAImOehqHUZ5m9t-XGoA@2x.png" /></figure><p><strong>Product: </strong><a href="https://www.revolut.com/introducing-revolut-metal">https://www.revolut.com/introducing-revolut-metal</a></p><p><strong>Product details:</strong></p><p>A premium account and debit card from Revolut app.</p><p><strong>3 things we like about it:</strong></p><ul><li>Top Images and videos make me want to upgrade for a Revolut Metal without knowing what are the benefits</li><li>The body section quickly communicates the benefits of the offer.</li><li>The overall look reflects the exclusivity of the product</li></ul><h3>22) Join</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*5-3jlRMCVDR03uF4z9uAsw@2x.png" /></figure><p><strong>Product: </strong><a href="https://join.com/">https://join.com/</a></p><p><strong>Product details:</strong></p><p>A platform to help you reach the best candidates for your open positions.</p><p><strong>3 things we like about it:</strong></p><ul><li>Simple and very modern design</li><li>You can understand what the product does without scrolling below the hero section</li><li>The <em>how it works</em> part clearly communicates functionalities and benefits of using the product.</li></ul><h3>23) Brew</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*6GS2MEjogDICtdm3XH9tmw@2x.png" /></figure><p><strong>Product: </strong><a href="https://www.brew.com/">https://www.brew.com/</a></p><p><strong>Product details:</strong></p><p>Help podcasters publish and monetize their best work.</p><p><strong>3 things we like about it:</strong></p><ul><li>The design reflects the mobile app look and feel</li><li>The message clearly communicates what visitors will get after downloading the app.</li><li>The page isn’t rich in contents, but they are well displayed and organized</li></ul><h3>24) Specify</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*WFtr8LMRFtmnmGEWWI4ffw@2x.png" /></figure><p><strong>Product: </strong><a href="https://specifyapp.com/">https://specifyapp.com/</a></p><p><strong>Product details:</strong></p><p>A tool designed to maintain large products and design systems.</p><p><strong>3 things we like about it:</strong></p><ul><li>The 3d illustrations (they are literally beautiful)</li><li>The product screenshots show the visitors what they’ll get subscribing for early access</li><li>The color scheme pops on this page’s background.</li></ul><h3>25) Mogney</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*aoZa5Mj_Dh4AZqsx5eoftQ@2x.png" /></figure><p><strong>Product: </strong><a href="https://mogney.com/">https://mogney.com/</a></p><p><strong>Product details:</strong></p><p>A is a service for QR code payments.</p><p><strong>3 things we like about it:</strong></p><ul><li>Strong visual identity</li><li>Surprisingly, horizontal navigation makes getting through pages a breeze</li><li>Illustrations and reveal animations are very well designed</li></ul><h3>26) Refactoring UI: The Book</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*koTgfTNFYT35wp8vtrunqA@2x.png" /></figure><p><strong>Product: </strong><a href="https://refactoringui.com/book/">https://refactoringui.com/book/</a></p><p><strong>Product details:</strong></p><p>Learn how to design beautiful user interfaces by yourself using specific tactics explained from a developer’s point-of-view.</p><p><strong>3 things we like about it:</strong></p><ul><li>The personal-human touch makes this page very warm and welcoming</li><li>The message is clear and straight to the point: Target, problem, and solution</li><li>The product description makes me excited about what I will learn by reading the book.</li></ul><h3>27) Microsoft by the Numbers</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*feitjeg5x7aENkHCkdPKkQ@2x.png" /></figure><p><strong>Product: </strong><a href="https://news.microsoft.com/bythenumbers/en/homepage">https://news.microsoft.com/bythenumbers/en/homepage</a></p><p><strong>Product details:</strong></p><p>Get an inside look at the people, places, and ideas that move Microsoft.</p><p><strong>3 things we like about it:</strong></p><ul><li>Illustrations are impactful without drawing visitors attention.</li><li>Animations are very nice and sleek</li><li>The parallax effect “forces” visitors to focus on a single story at the time (without distractions)</li></ul><h3><strong>28) Good Marketing</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*URZp-4gwUKk3fvcEN8Ztxw@2x.png" /></figure><p><strong>Product: </strong><a href="https://good-marketing.com/">https://good-marketing.com/</a></p><p><strong>Product details:</strong></p><p>Learn the tactics used by successful startups to sell their product</p><p><strong>3 things we like about it:</strong></p><ul><li>The personal-human touch makes this page very warm and welcoming</li><li>Great use of white space, typography, and nice color scheme</li><li>Contents and key information are organized very well across the page</li></ul><h3>29) SIMFORM</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*P7TQZlNoWDm3J9picOICqA@2x.png" /></figure><p><strong>Product: </strong><a href="https://www.simform.com/">https://www.simform.com/</a></p><p><strong>Product details:</strong></p><p>We manage teams of world-class developers to bring your vision to life</p><p><strong>3 things we like about it:</strong></p><ul><li>Friendly and trustworthy look and feel</li><li>Great balance of 3D illustrations and human images to reinforce the brand</li><li>They explain <em>the what</em> (what they do), <em>the how</em> (how they do that), and <em>the why</em> (why you should trust them) in a clear and concise way</li></ul><h3>30) Panda</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*4iaQhQpmdaVtKYQB-10WxQ@2x.png" /></figure><p><strong>Product: </strong><a href="https://usepanda.com/">https://usepanda.com/</a></p><p><strong>Product details:</strong></p><p>Discover the best tools, resources, and inspiration in the world of design and tech.</p><p><strong>3 things we like about it:</strong></p><ul><li>The hero section makes a great job by explaining what Panda does and why you should consider using it</li><li>Animations and illustrations make this page very friendly and welcoming</li><li>Simplicity and the great use of white space</li></ul><h3>Stay inspired!</h3><p>If you’re looking for more inspiration, here are some of our favorite landing page galleries 👇</p><ul><li><a href="https://saaslandingpage.com/">SaaS Landing Page</a></li><li><a href="https://land-book.com/">Land-Book</a></li><li><a href="https://www.lapa.ninja/">Lapa</a></li><li><a href="https://www.landingfolio.com/">Landingfolio</a></li><li><a href="https://onepagelove.com/">One Page Love</a></li></ul><h4>Enjoyed this post? Get the next articles, tutorials and templates directly in your inbox 👉 <a href="https://cruip.com/#subscribe">Subscribe</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f0698fb21e91" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cruip/20-amazing-landing-page-examples-for-your-personal-inspiration-in-2019-f0698fb21e91">30 amazing landing page examples for your personal inspiration in 2019</a> was originally published in <a href="https://medium.com/cruip">Cruip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a landing page with Cruip — Changing the color palette]]></title>
            <link>https://medium.com/cruip/building-a-landing-page-with-cruip-changing-the-color-palette-a146d1aa01a9?source=rss----15e394aa5deb---4</link>
            <guid isPermaLink="false">https://medium.com/p/a146d1aa01a9</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[landing-pages]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[sass]]></category>
            <dc:creator><![CDATA[Pasquale Vitiello]]></dc:creator>
            <pubDate>Tue, 16 Apr 2019 09:14:04 GMT</pubDate>
            <atom:updated>2019-07-26T15:20:20.598Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building a landing page with Cruip — Changing the color palette</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KLdMJKiC71Vbe_zpAzv8wA.png" /></figure><blockquote><em>This is the second part of a series of step-by-step tutorials where we will walk you through every aspect of customizing a Cruip landing page template from the ground up.</em></blockquote><blockquote><em>Didn’t you know about </em><a href="https://cruip.com/"><em>Cruip</em></a><em>? Check it out 👇</em></blockquote><p><a href="https://cruip.com/">HTML, Vue.js and React templates for startup landing pages - Cruip</a></p><h3>Premise</h3><p>Behind every Cruip template, there is a solid design project. <a href="https://twitter.com/DavidePacilio">Davide Pacilio</a> is the head of design and the man who ensures the respect of the best design standards. He uses to provide an essential (but very accurate) design system that guarantees a consistent visual identity for each template.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*0xmy8a4OexME2ajXQxJQGQ@2x.png" /><figcaption>Evelyn color palette</figcaption></figure><h3>The color palette</h3><p>On the left, there is the color scheme we’ve built for one of the most-downloaded Cruip templates of all time: <a href="https://demo.cruip.com/evelyn/">Evelyn</a>.</p><p>The palette includes:</p><ul><li>3 shades for grey (for the typography)</li><li>3 shades for grey (for the background)</li><li>3 shades for blue (primary color)</li><li>3 shades for green (secondary color)</li><li>2 additional colors (to generate gradients)</li></ul><p><em>Since the development of Evelyn, we’ve evolved and refined this color scheme, but the basic approach remains the same.</em></p><p>Let’s have a look at the file that contains the CSS variables and select the src/scss/abstracts/_variables.scss file (it includes many other variables but let’s focus on the $color map for now)👇</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rhpm6Tavb92h96KKJZNxmw.png" /></figure><p>As you can see the color scheme reflects the color palette above with the only difference of the typographysub-map, which includes 2 extra colors (1iand 2i) used to invert the typography color scheme when you have a darker background (e.g on the hero section).</p><h3>How to get colors from the palette</h3><p>In CSS you would normally use background: #FFFFFF; to set a white background color, right? Well, in this case, the syntax is a bit different because we are using a variable (i.e. $color), which is a map of values.</p><p>I guess you are wondering: How can I extract the #FFFFFF color from $color-&gt;bg-&gt;1? To make things super-simple, we have included a <a href="http://thesassway.com/advanced/pure-sass-functions">Sass function</a> to get a color from a map in an easy and understandable way 👇</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sbNUesapz_dsT0fXx_xsjA.png" /></figure><p><strong>Function usage is very simple:</strong></p><ul><li>color(bg, 1) returns #FFFFFF</li><li>color(typography, 2) returns #5B6F82</li><li>color(primary, 3) returns #007585</li><li>… and so on …</li></ul><p>So, stop using colors like this: background: #FFFFFF; and go withbackground: color(bg, 1); instead. Using this technique, you can change the value of #FFFFFF in one place, and all the instances where it has been used will change as well. It’s nice, is it? 😉</p><h3>Playing around with the color variables</h3><p>From that point on, you should have a clear understanding of <strong>how to get colors</strong> and <strong>where color variables are</strong>, so let’s get our hands dirty with some experiments!👨‍💻</p><p>Open the Terminal and use the command line to navigate to the root directory of your template (cd /path/to/evelyn). Then type npm run watch command (as we have shown in the first <a href="https://medium.com/cruip/building-a-landing-page-with-cruip-getting-started-with-npm-scripts-dbbbf2ec501d">tutorial</a>). It will start a new server, open up a browser and watch for any SCSS or JS changes in the src directory.👇</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UOQs4fBnr-lGIMBublTX_w.gif" /></figure><p>Ready to go! Open the template folder with an editor of your choice, <strong>change color values</strong> into thesrc/scss/abstracts/_variables.scss file and save changes. 👇</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wwx0uXdWT5d7eLTKUEm11w.gif" /></figure><p>Et voilà! Changes are immediately reflected in the browser! We’ve only changed primary and secondary colors and Evelyn has already got a new look and feel. Let’s have a look at the page <em>before</em> and <em>after</em> the color updates👇</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N_EBDW25GJNxkLg_yY4iTg.jpeg" /></figure><p>As you can notice, for a few elements colors have not changed. Here is the full list of elements who aren’t affected by color palette changes:</p><ul><li>Header and footer logos</li><li>Social proof logos</li><li>Product features icons</li><li>Images/illustrations below the section <em>Meet Evelyn</em></li><li>Social icons</li></ul><p>That’s pretty normal because all the elements listed above are SVGs, and color properties are defined inside the SVGs themselves… Of course, we’ll talk about SVG customizations during the next series!</p><p>Some final things that don’t look very good are the buttons. The primary button (on the right-hand side) looks acceptable. However, we can’t say the same for the secondary one (on the left-hand side).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*48I6QUrIugbDaZ5_scKiPw.jpeg" /></figure><p>We will walk you through button customizations during the next tutorial. In the meantime, if you’ve missed the first part of <em>building a landing page with Cruip, </em>follow the link below 👇</p><p><a href="https://medium.com/cruip/building-a-landing-page-with-cruip-getting-started-with-npm-scripts-dbbbf2ec501d">Building a landing page with Cruip — Getting started with NPM Scripts</a></p><h4>Enjoyed this post? Get the next articles, tutorials and templates directly in your inbox 👉 <a href="https://cruip.com/#subscribe">Subscribe</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a146d1aa01a9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cruip/building-a-landing-page-with-cruip-changing-the-color-palette-a146d1aa01a9">Building a landing page with Cruip — Changing the color palette</a> was originally published in <a href="https://medium.com/cruip">Cruip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to create a SaaS landing page that converts]]></title>
            <link>https://medium.com/cruip/how-to-create-a-saas-landing-page-that-converts-488942461186?source=rss----15e394aa5deb---4</link>
            <guid isPermaLink="false">https://medium.com/p/488942461186</guid>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[landing-pages]]></category>
            <category><![CDATA[landing-page-design]]></category>
            <category><![CDATA[landing-page-optimization]]></category>
            <category><![CDATA[learn]]></category>
            <dc:creator><![CDATA[Davide Pacilio]]></dc:creator>
            <pubDate>Tue, 26 Feb 2019 10:16:35 GMT</pubDate>
            <atom:updated>2022-03-11T16:06:38.628Z</atom:updated>
            <content:encoded><![CDATA[<h4>Build a SaaS landing page that delights visitors, converts prospects, and gains customers</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JXZ0tPwAMhTbSR4IItxngQ.png" /></figure><p><em>Last Updated on March 11, 2022</em></p><p>When it comes to creating a landing page that converts, there’s always been a lot of uncertainty over what the ideal outcome would look like.</p><p>While building <a href="https://cruip.com/">Cruip</a>, I’ve encountered many questions from founders about whether they are getting different aspects of their landing page right. Questions like:</p><ul><li>Is the foundation of my landing page good enough?</li><li>Is the key information in the right order?</li><li>Is the product message clear?</li></ul><p>Let’s be frank: There are countless compelling articles about how to create a conversion-driven landing page, but from our experience, none of them is distinct from SaaS products and most importantly, they don’t outline the fundamentals of how to structure your landing page for maximum conversion. Topics like:</p><ul><li>What’s the end goal of your landing page</li><li>What kind of information you should include</li><li>How to present the key messages in the right order</li></ul><p>So in this guide, we’re going to focus on the anatomy of a perfect landing page, and how to structure your contents for maximum conversions.</p><p>Are you ready? So, let’s get started :)</p><h3>Defining your goal</h3><p>The first critical step to creating a high-converting landing page starts by having a deep understanding of your product/business end goal.</p><p>For a SaaS company, for example, a typical end goal is to influence visitors to sign up for a free trial or to grow an email list before launching a new product.</p><p>The end goal very depends on your kind of product and business model, so it’s very important to get it right before you start developing your landing page.</p><p>Here are a few examples of landing page goals:</p><ul><li>Convince a prospect to sign up for a free trial</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*OPQ49zu8ti8T0xUCsO6rWQ@2x.png" /><figcaption>QuestionScout</figcaption></figure><ul><li>Collect pre-orders to validate a business idea</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*0Tpnhsu0daOoTesFhtYEiQ.png" /><figcaption>Relay</figcaption></figure><ul><li>Grow an email list before launching a new product</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*JMA4WQiXBOjPga7Xui3qhw@2x.png" /><figcaption>Circa</figcaption></figure><p><strong>Are you building a landing page? Use one of these beautiful templates to help you get started</strong>👇</p><p><a href="https://cruip.com/">HTML, Vue.js and React templates for startup landing pages - Cruip</a></p><p>When you start developing your landing page with your end goal in mind, you can work backwards to determine what information is essential to achieving that goal, and what to leave behind as secondary information.</p><blockquote>When everything is important, nothing is important</blockquote><p>Remember: Including more information than what’s necessary will dilute the power of your message, and when that happens, your landing page quickly loses focus. And your visitor’s bounce.</p><p>Did you know? It’s estimated that up to 50 per cent of prospects will bounce your landing page in the first eight seconds, so your critical mission is to capture their attention as quickly as possible, and to deliver your key messages straight away.</p><h3>Crafting the basic structure</h3><p>For this guide, we were unable to cover multiple SaaS landing page goals, so in order to generate a specific development route, I’ve created an imaginary product (a social media management tool) and the landing page foundation based on its specific goal. In this case:</p><blockquote>Convince prospects to sign up for a free trial</blockquote><p>If your product doesn’t fall under this particular case scenario, don’t worry, you can always apply these practices.</p><p>The first important step to define the landing structure of our social media management tool begins by establishing what contents we’re going to include and in what order. Let’s begin with the contents first:</p><ul><li><strong>Header</strong></li><li><strong>Hero</strong></li><li><strong>Social proofs</strong></li><li><strong>Product features (and benefits)</strong></li><li><strong>Customer testimonials</strong></li><li><strong>Bottom call to action</strong></li><li><strong>Footer</strong></li></ul><blockquote>Remember: Our main goal is to convince prospects to sign up for a free trial</blockquote><p>Later in this article, will talk about each content separately, but before that, let’s set the order of our landing page: What we’re going to include first, and what later, and most importantly, what’s the logic behind the content hierarchy?</p><p>There are countless powerful frameworks to organize your landing page content hierarchy, but for this specific scenario, we’re going to stick with a straightforward structure that we’ve tested and utilized several times. It includes three main sections:</p><p><strong>1) Above the fold </strong><em>(hero and header) — </em>It’s estimated that 80% of all visitors abandon a landing page before moving to the body section, so getting this section right is crucial to capture your prospect’s attention and motivate them to keep reading.</p><p><strong>2) The body </strong><em>(social proofs and product features/benefits) — </em>This is probably the longest section of your landing page. It’s where you will explain what your product does (in detail), why it’s perfect for your audience, and how it makes your customers’ lives better.</p><p><strong>3) Final call to action </strong><em>(customer testimonials and bottom call to action) — </em>The moment of truth. This is where you will ask your visitors to do your desired action, and where you’ll prove why it’s secure to believe you via customer testimonials.</p><p>As you can see, we’ve deliberately left the footer aside from the three main sections. The reason is that we’ll use this part for all the secondary information so we can’t consider it as an indispensable element to reach our goal.</p><p>Here is an example of all three-page sections working together:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l4cHbt39WFe3E1kQXMDxDw.png" /></figure><p>Feel free to download the landing page mockup <a href="https://www.dropbox.com/s/5dmv6r5bm7w2z1e/Landing-Mockup.zip?dl=0">here</a> (Sketch file).</p><p>A huge inspiration for this approach comes from the beautiful book <a href="https://www.amazon.com/Websites-that-Convert-fundamentals-compelling-ebook/dp/B06Y3L3W84">Websites that Convert</a> by Claire Suellentrop (that I strongly recommend).</p><h3>Content details</h3><p>From that point on, you should have a deep understanding of the importance of your landing page goal, and how to organize your content for maximum conversions.</p><p>Now it’s time to explore each content individually, starting from the header.</p><h4>Header</h4><p><em>It includes a product logo, navigation links, and call to actions</em></p><p><strong>Navigation links (best practices):</strong></p><p>Traditional navigation requires the presence of additional inner pages and isn’t always mandatory (especially with stand-alone landing pages).</p><p>I would suggest having the main website links on the header (e.g: pricing, product features etc..) and leaving all the secondary information for the footer (e.g: social icons, newsletter etc..).</p><p><strong>Call to actions (best practices):</strong></p><p>Header call to action should match the main landing CTA (the ones on the hero and above the footer), with the exception of the sign-in button (if required).</p><h4>Hero</h4><p><em>It includes a headline, sub-headline, imagery, and call to actions</em></p><p><strong>Value proposition:</strong></p><p>Your value proposition (the value you bring to your customers) should tell potential prospects why they should choose you over everyone else.</p><p>The be effective a value proposition must answer these three important visitor questions:</p><ol><li>Does your product or service solve my own problems?</li><li>What benefits can I expect?</li><li>Why should I buy from you over your competitors? (unique differentiation)</li></ol><p>You have to present your value proposition as the first thing they see on your landing page and it has to be presented between your headline and sub-headline.</p><p><strong>Headline (best practices):</strong></p><p>For a highly effective headline, you should provide a clear description of the purpose of your product, and what problem are you actually solving.</p><p>Be short and descriptive and avoid useless slogans at all costs. You’re not Nike, at least, not yet.</p><blockquote>If your prospect doesn’t understand what your product does from the headline, you probably won’t get a second chance.</blockquote><p><strong>Sub-headline (best practices):</strong></p><p>If your headline explains what you do, use your sub-headline to describe how your product does what says it does.</p><p>Specifically, your sub-headline should provide a specific explanation of what you do/offer, for whom and why is it useful.</p><p>Pro tip — Keep it within 2 lines of text, and avoid overwhelming your visitors with too many details before moving to the product features part.</p><p>Here is an example of a powerful value proposition in action:</p><p><strong>Product:</strong> <a href="https://www.mailpoet.com/">https://www.mailpoet.com/</a></p><p><strong>Target:</strong> WordPress-based websites</p><p><strong>Problem:</strong> Email bounces and delivery rate</p><p><strong>Benefit:</strong> By improving the delivery rate you can win more loyal subscribers</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*wWhZWGJN3VIpR8ZzvBlf6w.png" /></figure><p><strong>Imagery (best practices):</strong></p><p>Your hero imagery must match (or reinforce) the value proposition of your product (headline plus sub-headline) and has to deliver an extra level of clarity if your copy doesn’t make the job.</p><p>There is no secret souse for perfect imagery but as a designer, I personally prefer high-fidelity product screenshots instead of generic illustrations that don’t add any value in terms of clarity and product purpose.</p><p>Effective imagery should provide an immediate understanding of what you’re doing, and show off your value proposition in a visual and compelling way.</p><p>Here are 3 examples of powerful imagery:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fLQzWtiDlpE71G_M7shY9A.png" /><figcaption>N26</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*-4ZCp9DKvq9iKMODXiG-SA@2x.png" /><figcaption>Draftbit</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*dlIVeMFxeAsjDltQHt3CYw@2x.png" /><figcaption>#paid</figcaption></figure><p><strong>Call to actions (best practices):</strong></p><p>A CTA needs to reflect a benefit; an action that your audience wants to complete.</p><p>The more descriptive you are about the action you want your visitor to take, the better your chances to activate a prospect into a potential customer.</p><p>Make it stands out and ask yourself: What will they get by clicking that button?</p><h4>Social proofs</h4><p><em>It includes logos of press coverage you’ve collected around the web</em></p><p><strong>Social proofs (best practices):</strong></p><p>Especially in the early stages of your company, you probably won’t have a long list of press coverages from big tech publications like TechCrunch, Wired, The Next Web etc.</p><p>That’s not a problem.</p><p>If you’re just starting out, you have to include social proofs to demonstrate that someone is talking about the solution you’re providing, and your product has already been recognized.</p><p>If you have close to zero coverages, you can use social proofs from portals where you’re product has been featured (e.g: ProductHunt, Betalist etc..) or from blogs, social media or lists where you’ve been (positively) mentioned (e.g: Reddit, HackerNews etc..).</p><p>A final note about social proofs: If you run a fully bootstrapped business, you will have a hard time getting any form of traditional recognition at the beginning. In this case, just do the work and don’t worry.</p><h4>Product features</h4><p><em>It includes app screenshots, videos, imagery etc.</em></p><p><strong>Product features (best practices):</strong></p><p>One of the biggest mistakes I see founders making with their product features is highlighting too many functionalities and ending up with something that is barely impossible to digest.</p><blockquote>Just as a reminder: Including more information than what’s necessary will dilute the strength of your message</blockquote><p>As a rule of thumb, a product features section should contain between 3 and 6 features.</p><p>If you’ve more than 6 features, I would suggest highlighting them with different hierarchies. For example:</p><p>4 zig-zag main features, plus 3 secondary bullet points.</p><p>Pro tip — If you’re having a hard time choosing which product feature to highlight first, study your current customers and ask what functionality they care about most and why. Don’t forget, they were all prospects once.</p><h4>Product benefits</h4><p><em>It includes app screenshots, videos, imagery etc.</em></p><p><strong>Product benefits (best practices):</strong></p><p>We’ve intentionally divided product features from benefits to discuss them separately but they always match each other on a landing page. Specifically:</p><p>[FEATURE] offers [ADVANTAGE] that [CREATES BENEFIT]</p><p>So we first explain the advantage of using a particular feature and then we demonstrate why that functionality can make them happier, more productive etc.. (the benefit).</p><p>Here is an example of features versus benefits (we&#39;ll use our social media management tool as a reference):</p><p>[FEATURE]: Powerful analytics and reporting for social engagement</p><p>[BENEFIT]: We put actionable data at your fingertips with easy-to-read reports on a variety of key metrics, <strong>so you can improve your engagement and celebrate your success.</strong></p><p>Thank you <a href="https://buffer.com/reply/">Buffer</a> for the inspiration.</p><h4><em>Customer testimonials</em></h4><p><em>It shows off how your current customers have benefited from your product or service</em></p><p><strong>Customer testimonials (best practices):</strong></p><p>When a potential prospect is still sceptical to trust you right away, there is no better way of showing off how your customer testimonials establish trust and encourage your visitors to take the final action.</p><p>To be truly effective a customer testimonial needs to resonate with your targeted audience, and convince your visitors that your product is trustworthy, and used by people just like them.</p><p>Basically, it has to contain that specific answer:</p><ul><li>What’s the biggest benefit you’ve seen as a result of using our product?</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*gZ0RRk2DtExlwQW2HUcPQA.png" /><figcaption>Buffer</figcaption></figure><p>Never make up fake reviews and always use real client testimonials. Customer testimonials are used to build trust and establish credibility and publishing fake reviews will destroy your credibility and eliminate trust.</p><p>Pro tip — Include a name and picture of the customer who provided it. This information will serve to legitimize the authenticity and credibility of your customers.</p><h4>Bottom CTA</h4><p><em>It includes 1+ calls to action and a short paragraph</em></p><p><strong>Bottom CTA (best practices):</strong></p><p>Generally, this is where all the magic happens, and where your prospect is eager to find the “AHA” moment using your product.</p><p>Ok, it’s time to wake up :)</p><p>We’ve already discussed some CTA best practices above, but in addition for this part, I would recommend avoiding any note of confusion adding too many calls and in order to prevent any kind of analysis paralysis (the inability to reach a decision).</p><p>Pro tip — Consider having a second call to action to push hesitant visitors into action. Here is an example from Stripe Billing:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*rpWfKEEY8j-mkidE6z07cA@2x.png" /><figcaption>Stripe Billing</figcaption></figure><h4><em>Footer</em></h4><p><em>It includes a product logo, navigation links, social media icons etc..</em></p><p><strong>Footer (best practices):</strong></p><p>As discussed previously, the footer should contain all the secondary information such as social media icons, newsletter, formal company details etc.</p><p>My unique advice is to never overcrowd this part and to keep all the information as tidy as possible. Here is a good example from Gumroad:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*mkwACjAF4pYMBkSsMMJe_Q@2x.png" /><figcaption>Gumroad</figcaption></figure><h3>Conclusion and further reading</h3><p>We hope this article has given you enough resources to put this knowledge into practice and to build your next SaaS landing page with more confidence.</p><p>If you feel stuck, I would recommend you to have a look at these additional resources:</p><ul><li><a href="https://saaslandingpage.com/">SaaS Landing Page</a> (a collection of beautiful SaaS landing pages for design inspiration)</li><li><a href="https://www.amazon.com/Websites-that-Convert-fundamentals-compelling-ebook/dp/B06Y3L3W84">Websites that Convert</a> (by Claire Suellentrop)</li><li><a href="https://www.julian.com/guide/growth/landing-pages">Landing Pages</a> (by Julian Shapiro)</li><li><a href="https://stripe.com/atlas/guides/landing-page-copy">Writing copy for landing pages</a> (by Joanna Wiebe via Stripe)</li></ul><h4><em>Enjoyed this post? Get the next articles, tutorials and templates directly in your inbox </em>👉 <a href="https://cruip.com/#subscribe">Subscribe</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=488942461186" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cruip/how-to-create-a-saas-landing-page-that-converts-488942461186">How to create a SaaS landing page that converts</a> was originally published in <a href="https://medium.com/cruip">Cruip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a landing page with Cruip — Getting started with NPM Scripts]]></title>
            <link>https://medium.com/cruip/building-a-landing-page-with-cruip-getting-started-with-npm-scripts-dbbbf2ec501d?source=rss----15e394aa5deb---4</link>
            <guid isPermaLink="false">https://medium.com/p/dbbbf2ec501d</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[landing-pages]]></category>
            <category><![CDATA[npm]]></category>
            <dc:creator><![CDATA[Pasquale Vitiello]]></dc:creator>
            <pubDate>Tue, 26 Feb 2019 10:16:22 GMT</pubDate>
            <atom:updated>2019-07-26T15:19:47.538Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building a landing page with Cruip — Getting started with NPM Scripts</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mhs4jk3kMZIbwIaXuxkSJw.png" /></figure><blockquote><em>This is the first part of a series of step-by-step tutorials where we will walk you through every aspect of customizing a Cruip landing page template from the ground up.</em></blockquote><blockquote><em>Didn’t you know about </em><a href="https://cruip.com/"><em>Cruip</em></a><em>? Check it out</em> 👇</blockquote><p><a href="https://cruip.com/">HTML, Vue.js and React templates for startup landing pages - Cruip</a></p><h3>The folder structure</h3><p>Let’s suppose you’ve just downloaded <a href="https://demo.cruip.com/laurel/">Laurel</a> but you have no idea where to start.</p><p>That can be pretty understandable at the beginning, so let’s start by having a look at the folder structure👇</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EhGceMESmw84JScciOEmgQ.png" /></figure><ul><li><strong>src/</strong> (stands for “source”) includes all the assets to be compiled (Sass files, non-linted JS files, and non-optimised images).</li><li><strong>dist/ </strong>(stands for “distribution”) includes production files only (for example, the stylesheet generated from Sass files, linted JS files, optimized images etc..).<strong> You should never work on those files as they are generated by NPM scripts.</strong></li></ul><p>We’re noticing that some users, in order to bypass NPM scripts, tend to get their hands dirty directly into the dist folder. That would be ok if you’re pushing just some light changes, but if it isn’t the case, this is not the right way to go.</p><p>Any kind of change should be made inside the src folder. Precisely, every time you make modifications to the files inside that folder, our scripts process them again and output the files for the production site into the dist folder. It sounds cool, does it? 😎</p><h3>Getting started with NPM Scripts</h3><p>Nowadays every frontend developer uses a build tool or <a href="https://scotch.io/tutorials/using-npm-as-a-build-tool">NPM as a build tool</a> to get rid of repetitive tasks (e.g. Sass compiling, minifying, JS linting, etc) and become more productive.</p><p>I managed to use Grunt before but, IMO, when you go with NPM scripts you will never look back. NPM scripts are becoming <a href="https://2017.stateofjs.com/2017/build-tools/results">more popular than any other build tool</a> at the time of writing; and the reason is simple: They are versatile, powerful and ridiculously easy to set up.</p><p>Basically, that’s why we decided to go with them for compiling our templates.</p><h4>Install Node.js and NPM</h4><p>NPM scripts require that Node.js &amp; NPM are both installed on your machine.</p><ul><li><strong>Test Node.js — </strong>To see if Node is correctly installed, open the Terminal, Windows Command Prompt or a similar command line tool, and type node-v. It prints a version number, and you should see something like this v10.4.1.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*5nQ6tpNbzitMF91OhnnR3g.gif" /></figure><p>If Node is not installed, you can choose your OS and installation method from <a href="https://nodejs.org/en/download/package-manager/">this page</a> and follow the instructions.</p><ul><li><strong>Test NPM </strong>— Type npm-v in Terminal. It prints an NPM’s version number and should see something like this 6.4.1.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*_IfuhGOyZ61ZE1cFZg5H-A.gif" /></figure><p>If NPM is not installed, follow the documentation at <a href="https://www.npmjs.com/get-npm">this page</a>.</p><h4>Provide a package.json file</h4><p>NPM requires a package.json file. This file lists all the packages your project depends on, and it specifies package versions your project can use via <a href="https://docs.npmjs.com/about-semantic-versioning">semantic versioning rules</a>. That makes your build reproducible and easier to share with other developers (Ref: <a href="https://docs.npmjs.com/creating-a-package-json-file">https://docs.npmjs.com/creating-a-package-json-file</a>).</p><p>Inside the template folder, you can see a package-sample.json file. You just need to rename this file with package.json and then customize it later.</p><h4>Install dependencies</h4><p>Now open the Terminal and use the command line to navigate the root directory of your template (cd /path/to/laurel). Tip: On OSX you can type cd and drag &amp; drop the laurel folder into the Terminal.</p><p>Type npm install to install all of the dependencies into your project (note, it may take a while 😉).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*01qEt0qNWzUCbc7zN1CBrQ.gif" /></figure><h4>You’re ready to go!</h4><p>Run any task by typing npm run task (where for task “task” we mean the name of the task in the “scripts” object). The most useful task for rapid development is npm run watch. It starts a new server, open up a browser and watch for any SCSS or JS changes in the src directory. Once it compiles those changes, the browser will automatically inject the changed files!</p><h3>Anatomy of the package.json file</h3><p>Our package.json file has been adapted from <a href="https://github.com/damonbauer/npm-build-boilerplate">Damon Bauer’s npm-build-boilerplate</a>. You don’t need to change anything inside the document, and I am just explaining how to run a specific script.</p><p>The document starts with some generic fields (i.e. name, version, description, etc) before listing thescripts. Let’s have a look 👇</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TS4JKvlS-ehmP7HleSQgUA.png" /></figure><p>Any listed script can be executed in the Terminal typing npm run and followed by the name of the script. So, for example, you can remove the whole dist folder typing npm run clean.</p><p>Scripts included in our templates handle a bunch of main tasks:</p><h4>CSS processing</h4><ul><li>npm run lint-scss catches errors, applies limits and enforces stylistic conventions (via <a href="https://www.npmjs.com/package/stylelint">stylelint</a> — settings are declared in the .stylelintrc file)</li><li>npm run scss compiles Sass to CSS (via <a href="https://www.npmjs.com/package/node-sass">node-sass</a>)</li><li>npm run autoprefixer adds vendor prefixes to CSS rules (via <a href="https://www.npmjs.com/package/autoprefixer">Autoprefixer</a>)</li></ul><h4>JS processing</h4><ul><li>npm run lint identifies and reports on patterns found in ECMAScript/JavaScript code (via <a href="https://www.npmjs.com/package/eslint">ESLint</a> — settings are declared in the .eslintrc file)</li><li>npm run uglify parses, compresses and beautifies the JS code (via <a href="https://www.npmjs.com/package/uglify-es">uglify-es</a>)</li></ul><h4>Minifying images</h4><ul><li>npm run imagemin optimizes images reducing the files size (via <a href="https://www.npmjs.com/package/imagemin-cli">imagemin-cli</a>)</li></ul><h4>Keep multiple browsers and devices in sync</h4><ul><li>npm run serve uses <a href="https://www.npmjs.com/package/browser-sync">BrowserSync</a> to ensure that every time you change your code and save, the page is auto-reloaded. That makes web development definitely faster.</li></ul><h4>Chained scripts</h4><p>Tasks listed above can be nested and chained into new scripts, and be sequentially invoked. For example, you can use npm run build:css to execute npm run lint-scss, npm run scss and npm run autoprefixer in one fell swoop. Yeah, that’s cool!</p><h4>TL;DR</h4><p>Use the npm run watch command when you’re in the development stage: it listens for files change and ensure that CSS compiling, JS linting, images minification and browser sync occur when needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ntNfZMrF_T92Xh0_Mp5Ptg.gif" /></figure><p>Use npm run build when you are done with the development and you are ready to wrap up the production site.</p><p>Hungry for more? Take a look at the next tutorial below👇</p><p><a href="https://medium.com/cruip/building-a-landing-page-with-cruip-changing-the-color-palette-a146d1aa01a9">Building a landing page with Cruip — Changing the color palette</a></p><h4>Enjoyed this post? Get the next articles, tutorials and templates directly in your inbox 👉 <a href="https://cruip.com/#subscribe">Subscribe</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbbbf2ec501d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cruip/building-a-landing-page-with-cruip-getting-started-with-npm-scripts-dbbbf2ec501d">Building a landing page with Cruip — Getting started with NPM Scripts</a> was originally published in <a href="https://medium.com/cruip">Cruip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>