How would I edit a SharePoint page using SPFX?

Pipkin, Thomas 21 Reputation points
2020-10-12T12:23:09.387+00:00

I want to put a sharepoint webpart created using spfx, onto a SharePoint page. I don't want the navigation bar on the left and I want the webpart to be central. Is this possible using SPFX?
If so, would it be an SPFX extension or would it be the JSX/CSS within the webpart that overrides the pages column width and nav bar?

My reason for asking is, I don't want to have to create a Communications site and it's 'full-width column' that a team site doesn't have, in order to add a webpart that I've made.

SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,619 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Jerryzy 10,571 Reputation points
    2020-10-13T07:53:18.417+00:00

    Hi @Pipkin, Thomas ,

    Currently, Full Width Column only supported for Communication Site, please see the same userVoice here:

    Full-Width Column Webpart available to Team Site Template

    A workaround is to create a SPFX Extension to inject the css below:

    [id='spLeftNav'] {  
        max-width: 0px !important;  
      }  
      
    [class^='CanvasSection']  
    {  
       margin-left:450px;  
    }  
    

    31779-snipaste-2020-10-13-15-48-35.png

    You may need to edit the CSS margin-left or add some other necessary style to adjust in your side.

    For inject CSS Style with SPFX Extension, please check the following demo:

    Inject Custom CSS on SharePoint Modern Pages using SPFx Extensions


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. sadomovalex 3,631 Reputation points
    2020-10-14T19:02:13.64+00:00

    check this solution created with SPFx: SharePoint Full Page Canvas App.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.