3

I currently have this code below for a progress-indicator. Is there a way I can show only 3 steps at a time and use arrows to navigate to see steps 4, 5, 6, etc.? Whenever I add more steps, the number of points keeps growing on the progress indicator. This would be a problem when dealing with a lot of steps as the progress-indicator would get crowded.

update: I have tried adding in-line styling for max-width and overflow-x to both the "slds-progress" and "slds-progress__list" divs.

<div class="slds-region_small slds-has-overflow" style="margin-top: 1%; margin-bottom:1%">
                <div class="slds-progress" style="max-width: 50%; overflow-x:scroll;">
                    <ol class="slds-progress__list">
                        <li class="slds-progress__item slds-is-active" value="1">
                            <div class="iconBox">
                                <lightning-icon 
                                    icon-name="utility:email" 
                                    title="email"
                                    id="email"
                                ></lightning-icon>
                                <span class="slds-assistive-text">Step 1 - Active</span>
                            </div>
                        </li>
                        <li class="slds-progress__item" value="2">
                            <div class="iconBox">
                                    <lightning-icon 
                                    icon-name="utility:task" 
                                    title="task">
                                    </lightning-icon>
                                <span class="slds-assistive-text">Step 2</span>
                            </div>
                        </li>

                        <li class="slds-progress__item" value="3">
                            <div class="iconBox">
                                    <lightning-icon 
                                    icon-name="utility:error" 
                                    title="error">
                                    </lightning-icon>
                                <span class="slds-assistive-text">Step 3</span>
                            </div>
                        </li>

                        <li class="slds-progress__item" value="4">
                            <div class="iconBox">
                                    <lightning-icon 
                                    icon-name="utility:task" 
                                    title="task">
                                <span class="slds-assistive-text">Step 4 </span>
                            </div>
                        </li>

                        <li class="slds-progress__item" value="5">
                            <div class="iconBox">
                                    <lightning-icon 
                                    icon-name="utility:task" 
                                    title="task">
                                <span class="slds-assistive-text">Step 5 </span>
                            </div>
                        </li>
                    </ol>
                    <div class="slds-progress-bar slds-progress-bar_x-small" 
                        aria-valuemin="0" 
                        aria-valuemax="100" 
                        aria-valuenow="0" 
                        role="progressbar" 
                        style="color:rgb(8, 102, 8);">
                    <span class="slds-progress-bar__value" style="width:0%">
                        <span class="slds-assistive-text">Progress: 0%</span>
                    </span>
                    </div>
                </div>
            </div>

1 Answer 1

2

the SLDS Blueprints have an example for handling this type of scenario:

in a nutshell, you can set a max width to your path component alongside a CSS overflow Property, that way, you can scroll through a set number of steps in your path indicator.

enter image description here

example css properties:

max-width: some-width;
overflow-x: auto;
6
  • i'm trying to do this in a progress-indicator component and i am able to add width, but the overflow property does not seem to work. i get the same result which is just a clumped up number of steps
    – mandooov
    Commented Aug 31, 2021 at 3:09
  • mind updating your post with your attempt? what element are you targeting with the css property and so on so i can have a look?
    – glls
    Commented Aug 31, 2021 at 3:13
  • i just updated the code to show what i have now
    – mandooov
    Commented Aug 31, 2021 at 14:43
  • were you able to resolve this, are you using the slds blueprints, test with a set max width that is not a percentage, and make sure the overflow is on the same element where you have the max width specified ?
    – glls
    Commented Sep 24, 2021 at 12:56
  • yes, i was able to get it working. thanks
    – mandooov
    Commented Sep 24, 2021 at 13:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .