<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Format labels/values on slider in Calcite Design System Questions</title>
    <link>https://community.esri.com/t5/calcite-design-system-questions/format-labels-values-on-slider/m-p/1174155#M138</link>
    <description>&lt;P&gt;Hello &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/564347"&gt;@BobCowling2&lt;/a&gt;, the Calcite Slider component is aimed more for numeric adjustable values. To showcase years there's a bit of customization needed.&lt;/P&gt;&lt;P&gt;On load you could set a Calcite Label to the initial slider value, and add an event listener to update the value as the user interacts with the component using the &lt;A href="https://developers.arcgis.com/calcite-design-system/components/slider/#component-api-events-calciteSliderChange" target="_blank" rel="noopener"&gt;calciteSliderChange&lt;/A&gt; event.&lt;/P&gt;&lt;P&gt;For instance, an example with the range of 1900-2000 and 1970 selected on initialization:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;style&amp;gt;
calcite-slider {
  width: 50vw;
  margin: auto;
  padding: 10px;
}
#sliderLabel {
  font-weight: bold;
}
&amp;lt;/style&amp;gt;

&amp;lt;calcite-label alignment="center" for="slider" id="sliderLabel"&amp;gt;1970&amp;lt;/calcite-label&amp;gt;
&amp;lt;calcite-slider id="slider" min="1900" max="2000" value="1970" step="1"&amp;gt;&amp;lt;/calcite-slider&amp;gt;

&amp;lt;script&amp;gt;
window.addEventListener("calciteSliderChange", (result) =&amp;gt; {
    const sliderVal = document.getElementById("slider").value;
    // Removes "," character from the number
    document.getElementById("sliderLabel").innerHTML = sliderVal.toString().replace(/,/g, "");
});
&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 16 May 2022 13:41:21 GMT</pubDate>
    <dc:creator>KittyHurley</dc:creator>
    <dc:date>2022-05-16T13:41:21Z</dc:date>
    <item>
      <title>Format labels/values on slider</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/format-labels-values-on-slider/m-p/1173994#M137</link>
      <description>&lt;P&gt;Is there a way to remove the thousands separator on the slider handle labels/values when it is static and being dragged? I am trying to format the values to allow the user to select a range between years years. For example I would like the labels to display "1970" instead of "1,970"&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/calcite-design-system/components/slider/" target="_blank"&gt;https://developers.arcgis.com/calcite-design-system/components/slider/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 14 May 2022 14:34:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/format-labels-values-on-slider/m-p/1173994#M137</guid>
      <dc:creator>BobCowling2</dc:creator>
      <dc:date>2022-05-14T14:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: Format labels/values on slider</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/format-labels-values-on-slider/m-p/1174155#M138</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/564347"&gt;@BobCowling2&lt;/a&gt;, the Calcite Slider component is aimed more for numeric adjustable values. To showcase years there's a bit of customization needed.&lt;/P&gt;&lt;P&gt;On load you could set a Calcite Label to the initial slider value, and add an event listener to update the value as the user interacts with the component using the &lt;A href="https://developers.arcgis.com/calcite-design-system/components/slider/#component-api-events-calciteSliderChange" target="_blank" rel="noopener"&gt;calciteSliderChange&lt;/A&gt; event.&lt;/P&gt;&lt;P&gt;For instance, an example with the range of 1900-2000 and 1970 selected on initialization:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;style&amp;gt;
calcite-slider {
  width: 50vw;
  margin: auto;
  padding: 10px;
}
#sliderLabel {
  font-weight: bold;
}
&amp;lt;/style&amp;gt;

&amp;lt;calcite-label alignment="center" for="slider" id="sliderLabel"&amp;gt;1970&amp;lt;/calcite-label&amp;gt;
&amp;lt;calcite-slider id="slider" min="1900" max="2000" value="1970" step="1"&amp;gt;&amp;lt;/calcite-slider&amp;gt;

&amp;lt;script&amp;gt;
window.addEventListener("calciteSliderChange", (result) =&amp;gt; {
    const sliderVal = document.getElementById("slider").value;
    // Removes "," character from the number
    document.getElementById("sliderLabel").innerHTML = sliderVal.toString().replace(/,/g, "");
});
&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2022 13:41:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/format-labels-values-on-slider/m-p/1174155#M138</guid>
      <dc:creator>KittyHurley</dc:creator>
      <dc:date>2022-05-16T13:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Format labels/values on slider</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/format-labels-values-on-slider/m-p/1174227#M139</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/564347"&gt;@BobCowling2&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;There is also a GitHub enhancement request to allow for custom handles and ticks:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/calcite-components/issues/4004" target="_blank"&gt;https://github.com/Esri/calcite-components/issues/4004&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2022 16:16:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/format-labels-values-on-slider/m-p/1174227#M139</guid>
      <dc:creator>BenElan</dc:creator>
      <dc:date>2022-05-16T16:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Format labels/values on slider</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/format-labels-values-on-slider/m-p/1219082#M250</link>
      <description>&lt;P&gt;Slider now has a &lt;A href="https://developers.arcgis.com/calcite-design-system/components/slider/#component-api-properties-groupSeparator" target="_blank"&gt;groupSeparator&lt;/A&gt; property. By default, the separator won’t be present (e.g., 2000). When true, a separator will be added (e.g., 2,000).&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;!-- Slider without separator --&amp;gt;
&amp;lt;calcite-slider min="2000" max="3000" value="2500" label-handles&amp;gt;&amp;lt;/calcite-slider&amp;gt;

&amp;lt;!-- Slider with separator --&amp;gt;
&amp;lt;calcite-slider min="2000" max="3000" value="2500" label-handles group-separator&amp;gt;&amp;lt;/calcite-slider&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 19:03:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/format-labels-values-on-slider/m-p/1219082#M250</guid>
      <dc:creator>KittyHurley</dc:creator>
      <dc:date>2022-10-05T19:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Format labels/values on slider</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/format-labels-values-on-slider/m-p/1418309#M631</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/564347"&gt;@BobCowling2&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;The enhancement request that Ben mentioned above has been released in &lt;A href="https://developers.arcgis.com/calcite-design-system/releases/changelogs/latest/" target="_self"&gt;2.8.0&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;The Related Issue:&amp;nbsp;&lt;A href="https://github.com/Esri/calcite-design-system/issues/4004#issuecomment-2075958104" target="_self"&gt;https://github.com/Esri/calcite-design-system/issues/4004#issuecomment-2075958104&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2024 19:24:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/format-labels-values-on-slider/m-p/1418309#M631</guid>
      <dc:creator>DitwanPrice</dc:creator>
      <dc:date>2024-05-02T19:24:27Z</dc:date>
    </item>
  </channel>
</rss>

