I just start exploring Local LWC development. The component preview is so small and it is showing in the middle of the screen. Is there any workaround to increase the width and height of the component by default?

      <lightning-card title="Hello">
        <lightning-button label="New" slot="actions"></lightning-button>
        <p class="slds-p-horizontal_small">Card Body (custom component)</p>
        <p slot="footer">Card Footer</p>

enter image description here

  • You can put the lightning card in a div and provide width for the div or add width to inner tags like p
    – manjit5190
    Mar 11, 2020 at 11:52

3 Answers 3


For local dev I generally always wrap the component I am developing into a "testing" LWC parent component. This lets you pass it parameters and generally interact with it as if it is sitting within your application.

To make it take up the whole area wrap your component with a DIV set to class "slds-grid_frame" in a parent testing LWC. This lets you view it full screen (or a controlled size) without modifying your actual component.

Code for parent testing LWC that wraps your component.

    <div class="slds-grid_frame">

Not exact answer, but adding anyway as searching for small viewport size directs here. My issue is that there wasn't enough space for component making it kinda useless. Thanks to Chuck Liddell for idea of using Chrome's overrides which I've detailed a bit more here - https://github.com/forcedotcom/lwc-dev-server-feedback/issues/18#issuecomment-736839151


Here is the solution I've came across using flexipageRegionWidth. This doesn't conflict with your org when deployed.


 <div class={flexipageRegionWidth}>


  min-width: 66rem;
  min-width: 40rem;
  min-width: 15rem;


import { LightningElement, api } from "lwc";

export default class LibsD3 extends LightningElement {
  @api flexipageRegionWidth = "CLASSIC"

  • I've tried the above and am using the SMALL variant and I have included a simple child component that only displays a lightning-record-form and it displays like this i.stack.imgur.com/Y4tDw.png. Any idea why?
    – JodieM
    Jul 12, 2020 at 9:28

You must log in to answer this question.

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