The step indicator is a useful form component when users fill out forms. For multipage forms, it allows them the ability to view what step of the form they are on. Using some CSS and HTML, you can wrap it as a list container. You can read about step indicator from the USWDS website.
On small screens/mobile devices:
The JS
None
The HTML
You can create a step indicator using Knack's Rich Text View and copy paste the list elements.
Add the CSS below. Modify Line 52width: XX% depending on how many list elements there are divided by 100%. Otherwise the step indicator bar widths will appear too small/large.
5 list items = 20%
4 list items = 25%
3 list items = 32%
/***************************//**** Step Indicator *******//***************************/.stepindicator{width:100%;z-index:1;display:flex;position:static;}.label-stepindicator{display:inline-block;width:1.5em;height:1.5em;background:#005EA2;border-radius:50%;text-align:center;font-weight:bold;color:white;line-height:1.5em;font-size:1.5em;}.active-label-stepindicator{font-weight:bold;font-size:1.5em;margin-left:20px;}.progressbar{counter-reset:step;}/* This is for the Circle number */.progressbarli:before{content:counter(step);counter-increment:step;width:30px;height:30px;border:2px solid #bebebe;display:block;border-radius:50%;line-height:26px;background:white;color:#bebebe;text-align:center;font-weight:bold;}/* This is for the bars */.progressbarli{list-style-type:none;float:left;width:25%;position:relative;text-align:left;margin-left:-5px;}.progressbarli+li {margin-top:unset;}.progressbarli:after{content:'';position:absolute;width:100%;height:8px;background:#979797;top:10px;left:-90%;z-index:-1;}/* Hides the first child bar */.progressbarli:first-child:after{content:none;}.progressbarli.active+li:after{background:#005EA2;}.progressbarli.active::before{border:2px solid white;background:#005EA2;color:white;}.progressbarli.active{font-weight:bold;color:#005EA2;}.progressbarli.inactive{font-weight:bold;color:#163f6e;}.progressbarli.inactive+li:after{background:#163f6e;}.progressbarli.inactive::before{border-color:white;background:#163f6e;color:white;}
If you have mobile screens using the @media breakpoints and add additional CSS below.
/* For mobile screens step indicator */@mediaonlyscreenand (max-width:600px) {.progressbarli:before{margin-top:-33px;line-height:18px;width:20px;height:20px;border-width:1px; }.progressbarli.active::before{border-width:1px; }.progressbarli,.progressbarli.active,.progressbarli.inactive {font-size:11px;padding-top:15px; }.progressbarli:after{border-left:1px solid white;height:10px;margin-top:-2em; }}