0

I am using sfdx force:lightning:lwc:start to start a localhost where I test my LWCs. It has been working fine until recently, where I tried to render progressBar:

 <template>
    <lightning-progress-bar value=50 size="large"></lightning-progress-bar>
</template>

Nothing shows - but other components do. What is the reason for this, anyone has similar experience?

1 Answer 1

1

lightning-progress-bar wants to take up 100% of the parent's allocated space for it, but in the lightning web previewer, that space is calculated on the contents of the component. Net result: the component ends up being zero pixels wide, so you see nothing. You need to give the component a non-zero width somehow. Here's a simple example:

<template>
  <div style="min-width: 20vw">
    <lightning-progress-bar value="50" size="large"></lightning-progress-bar>
  </div>
</template>
1
  • Thanks @sfdcfox
    – DevelBase2
    Commented Feb 6, 2022 at 18:35

You must log in to answer this question.

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