Search results

Sidebar with TreeView in React Sidebar component

25 Jan 2023 / 1 minute to read

The following example demonstrates how to render TreeView component inside the Sidebar with dock state and how to achieve expand and collapse the functionalities simultaneously in the sidebar and Treeview.

On collapse, the LI elements of TreeView show icons only to represent the short sign of the hidden text content. On expand, hidden text content will be set to be visible.

Source
Preview
App.jsx
index.jsx
index.html
style.css
App.tsx
index.tsx
Copied to clipboard
import * as React from 'react';
import { SidebarComponent, TreeViewComponent } from '@syncfusion/ej2-react-navigations';
function App() {
    let sidebarobj;
    let treeviewobj;
    let data = [
        {
            nodeId: '01', nodeText: 'Installation', iconCss: 'icon-microchip icon',
            nodeChild: [
                { nodeId: '05-01', nodeText: 'Calendar', iconCss: 'icon-circle-thin icon' },
                { nodeId: '05-02', nodeText: 'DatePicker', iconCss: 'icon-circle-thin icon' },
                { nodeId: '05-03', nodeText: 'DateTimePicker', iconCss: 'icon-circle-thin icon' },
                { nodeId: '05-04', nodeText: 'DateRangePicker', iconCss: 'icon-circle-thin icon' },
                { nodeId: '05-05', nodeText: 'TimePicker', iconCss: 'icon-circle-thin icon' },
                { nodeId: '05-06', nodeText: 'SideBar', iconCss: 'icon-circle-thin icon' }
            ]
        },
        {
            nodeId: '02', nodeText: 'Deployment', iconCss: 'icon-thumbs-up-alt icon',
        },
        {
            nodeId: '03', nodeText: 'Quick Start', iconCss: 'icon-docs icon',
        },
        {
            nodeId: '04', nodeText: 'Components', iconCss: 'icon-th icon',
            nodeChild: [
                { nodeId: '04-01', nodeText: 'Calendar', iconCss: 'icon-circle-thin icon' },
                { nodeId: '04-02', nodeText: 'DatePicker', iconCss: 'icon-circle-thin icon' },
                { nodeId: '04-03', nodeText: 'DateTimePicker', iconCss: 'icon-circle-thin icon' },
                { nodeId: '04-04', nodeText: 'DateRangePicker', iconCss: 'icon-circle-thin icon' },
                { nodeId: '04-05', nodeText: 'TimePicker', iconCss: 'icon-circle-thin icon' },
                { nodeId: '04-06', nodeText: 'SideBar', iconCss: 'icon-circle-thin icon' }
            ]
        },
        {
            nodeId: '05', nodeText: 'API Reference', iconCss: 'icon-code icon',
            nodeChild: [
                { nodeId: '05-01', nodeText: 'Calendar', iconCss: 'icon-circle-thin icon' },
                { nodeId: '05-02', nodeText: 'DatePicker', iconCss: 'icon-circle-thin icon' },
                { nodeId: '05-03', nodeText: 'DateTimePicker', iconCss: 'icon-circle-thin icon' },
                { nodeId: '05-04', nodeText: 'DateRangePicker', iconCss: 'icon-circle-thin icon' },
                { nodeId: '05-05', nodeText: 'TimePicker', iconCss: 'icon-circle-thin icon' },
                { nodeId: '05-06', nodeText: 'SideBar', iconCss: 'icon-circle-thin icon' }
            ]
        },
        {
            nodeId: '06', nodeText: 'Browser Compatibility', iconCss: 'icon-chrome icon'
        },
        {
            nodeId: '07', nodeText: 'Upgrade Packages', iconCss: 'icon-up-hand icon'
        },
        {
            nodeId: '08', nodeText: 'Release Notes', iconCss: 'icon-bookmark-empty icon'
        },
        {
            nodeId: '09', nodeText: 'FAQ', iconCss: 'icon-help-circled icon'
        },
        {
            nodeId: '10', nodeText: 'License', iconCss: 'icon-doc-text icon'
        }
    ];
    let width = '290px';
    let target = '.main-content';
    let mediaQuery = '(min-width: 600px)';
    let dockSize = "44px";
    let fields = { dataSource: data, id: 'nodeId', text: 'nodeText', child: 'nodeChild' };
    function onCreate() {
        sidebarobj.element.style.visibility = '';
    }
    function onClose() {
        treeviewobj.collapseAll();
    }
    function toggleClick() {
        if (sidebarobj.isOpen) {
            sidebarobj.hide();
            treeviewobj.collapseAll();
        }
        else {
            sidebarobj.show();
            treeviewobj.expandAll();
        }
    }
    let sidbarToggle = null;
    return (
    // Sidebar Element Declaration
    <div className="control-section">
            <div id="wrapper">
                <title>Essential JS 2 for React - Sidebar {'>'} Sidebar with ListView </title>
                <div className="col-lg-12 col-sm-12 col-md-12">
                    <div className='main-header' id='header-section'>
                        <ul className='header-list'>
                            <li className='float-left header-style icon-menu' id='hamburger' onClick={toggleClick} ref={sidebar => sidbarToggle = sidebar}></li>
                            <li className='float-left header-style nav-pane'><b>Navigation Pane</b></li>
                            <li className='header-style float-right support border-left'><b>Support</b></li>
                        </ul>
                    </div>
                    <SidebarComponent id="sidebar-treeview" ref={Sidebar => sidebarobj = Sidebar} width={width} target={target} mediaQuery={mediaQuery} style={{ visibility: "hidden" }} created={onCreate} close={onClose} dockSize={dockSize} enableDock={true}>
                        <div className='main-menu'>
                            <div>
                                <TreeViewComponent id='main-treeview' ref={Treeview => treeviewobj = Treeview} fields={fields} expandOn='Click'/>
                            </div>
                        </div>
                    </SidebarComponent>
                    <div className="main-content" id="main-text">
                        <div className='sidebar-content'>
                                <h2 className='sidebar-heading'> Responsive Sidebar With Treeview</h2>
                                <p className='paragraph-content'> This is a graphical aid for visualising and categorising the site,
                                in the style of an expandable and collapsable treeview component. It auto-expands to display the node(s),
                                if any, corresponding to the currently viewed title, highlighting that node(s) and its ancestors.
                                Load-on-demand when expanding nodes is available where supported (most graphical browsers), falling
                                back to a full-page reload. MediaWiki-supported caching, aside from squid, has been considered so
                                that unnecessary re-downloads of content are avoided where possible. The complete expanded/collapsed
                                state of the treeview persists across page views in most situations.</p>
                                <p className='paragraph-content'>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
                                    eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
                                    nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
                                    dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
                                    Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim
                                    id est laborum.</p>
                                <div className='line'></div>
                                <h2 className='sidebar-heading'>Lorem Ipsum Dolor</h2>
                                <p className='paragraph-content'>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
                                    eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
                                    nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
                                    dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>
                                <div className='line'></div>
                                <h2 className='sidebar-heading'> Lorem Ipsum Dolor</h2>
                                <p className='paragraph-content'>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
                                    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
                                    exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
                                    reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
                                    occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
                                <div className='line'></div>
                                <h2 className='sidebar-heading'> Lorem Ipsum Dolor</h2>
                                <p className='paragraph-content'>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
                                    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
                                    exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
                                    reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
                                    occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>);
}
export default App;
Copied to clipboard
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(<App />, document.getElementById('sample'));
Copied to clipboard
<!DOCTYPE html>
<html lang="en">

<head>
            
    <title>Syncfusion React Sidebar</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Essential JS 2 for React Components" />
    <meta name="author" content="Syncfusion" />
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
    <link href="//cdn.syncfusion.com/ej2/20.4.38/ej2-base/styles/material.css" rel="stylesheet" />
    <link href="//cdn.syncfusion.com/ej2/20.4.38/ej2-react-navigations/styles/material.css" rel="stylesheet" />
    <link href="style.css" rel="stylesheet" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
</head>

<body>
    <div id='sample'>
        <div id='loader'>Loading....</div>
    </div>
</body>

</html>
Copied to clipboard
/* header-section styles */
#header-section.main-header {
    border-bottom: 1px solid #d2d6de;
    height: 55px;
    min-height: 55px;
    max-height: 55px;
    background: #1c86c8;
    color: #fff;
}

#header-section .header-style {
    line-height: 40px;
    height: 55px;
    padding: 8px;
    list-style: none;
    text-align: center;
    font-size: 18px;
}

#header-section .border-left {
    border-left: 1px solid #d2d6de;
    width: 10em;
}

#header-section .float-left {
    float: left;
	padding-right: 0px;
}

#header-section .icon-menu {
    width: 40px;
    cursor: pointer;
}

.sb-content-tab #wrapper {
    display: none;
}

.center {
    text-align: center;
    display: none;
    font-size: 13px;
    font-weight: 400;
    margin-top: 20px;
}

.sb-content-tab .center {
    display: block;
}


#header-section .header-list,
#sidebar-treeview .e-treeview,
#sidebar-treeview .e-treeview .e-ul {
    padding: 0px;
    margin: 0px;
}

@media(max-width:800px) {

    #header-section .support {
        display: none;
    }

    #header-section .nav-pane {
        width: 75%;
    }
}

/*end of header-section styles */

/*main-menu-header  styles */
#sidebar-treeview .main-menu .main-menu-header {
    color: #656a70;
    padding: 15px;
    font-size: 14px;
    width: 13em;
    margin: 0;
}

/*end of main-menu-header styles */

/*text input styles */
#sidebar-treeview .main-menu .search-icon {
    text-indent: 10px;
    height: 30px;
    width: 18em;
}

/*end of text input styles */

/* table of content area styles */
#sidebar-treeview .table-content {
    padding: 20px;
}

/* end of table ofcontent area styles */

/* content area styles */
#main-text.main-content {
    overflow: hidden;
}

#main-text .sidebar-content .line {
    width: 100%;
    height: 1px;
    border-bottom: 1px dashed #ddd;
    margin: 40px 0;
}

#main-text .sidebar-content {
    padding: 15px;
}

#main-text .sidebar-heading {
    color: #1c86c8;
    margin: 40px 0;
    padding: 2px;
}

#main-text .paragraph-content {
    font-family: 'Poppins', sans-serif;
    padding: 5px;
    font-weight: 300;
    color: grey;
    }

/* end of content area styles */

/* body and html styles */
body {
    margin: 0;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* end of body and html styles */

/* icon styles */
@font-face {
    font-family: 'fontello';
    src: url('data:application/octet-stream;base64,AAEAAAAPAIAAAwBwR1NVQiCLJXoAAAD8AAAAVE9TLzI+JUkyAAABUAAAAFZjbWFw0almQAAAAagAAAIgY3Z0IAbV/vwAABfUAAAAIGZwZ22KkZBZAAAX9AAAC3BnYXNwAAAAEAAAF8wAAAAIZ2x5Zk3OJrMAAAPIAAAPrGhlYWQTw6AfAAATdAAAADZoaGVhB2gDnAAAE6wAAAAkaG10eDHm//YAABPQAAAAOGxvY2EejhqYAAAUCAAAAB5tYXhwAfYMkAAAFCgAAAAgbmFtZcydHiAAABRIAAACzXBvc3RuKDzPAAAXGAAAALRwcmVw5UErvAAAI2QAAACGAAEAAAAKADAAPgACREZMVAAObGF0bgAaAAQAAAAAAAAAAQAAAAQAAAAAAAAAAQAAAAFsaWdhAAgAAAABAAAAAQAEAAQAAAABAAgAAQAGAAAAAQAAAAEDkAGQAAUAAAJ6ArwAAACMAnoCvAAAAeAAMQECAAACAAUDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFBmRWQAQOgB6BMDUv9qAFoDUgCaAAAAAQAAAAAAAAAAAAUAAAADAAAALAAAAAQAAAF0AAEAAAAAAG4AAwABAAAALAADAAoAAAF0AAQAQgAAAAYABAABAALoCegT//8AAOgB6BD//wAAAAAAAQAGABYAAAABAAIAAwAEAAUABgAHAAgACQAKAAsADAANAAABBgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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yyAQFDKy2wXiyyAAA/Ky2wXyyyAAE/Ky2wYCyyAQA/Ky2wYSyyAQE/Ky2wYiywNysusSsBFCstsGMssDcrsDsrLbBkLLA3K7A8Ky2wZSywABawNyuwPSstsGYssDgrLrErARQrLbBnLLA4K7A7Ky2waCywOCuwPCstsGkssDgrsD0rLbBqLLA5Ky6xKwEUKy2wayywOSuwOystsGwssDkrsDwrLbBtLLA5K7A9Ky2wbiywOisusSsBFCstsG8ssDorsDsrLbBwLLA6K7A8Ky2wcSywOiuwPSstsHIsswkEAgNFWCEbIyFZQiuwCGWwAyRQeLABFTAtAEu4AMhSWLEBAY5ZsAG5CAAIAGNwsQAFQrIAAQAqsQAFQrMKAgEIKrEABUKzDgABCCqxAAZCugLAAAEACSqxAAdCugBAAAEACSqxAwBEsSQBiFFYsECIWLEDZESxJgGIUVi6CIAAAQRAiGNUWLEDAERZWVlZswwCAQwquAH/hbAEjbECAEQAAA==') format('truetype');
}

#sidebar-treeview #main-treeview .icon {
    font-family: 'fontello';
    font-size: 16px;
    margin-top: -4px;
}

#header-section.main-header .icon-menu::before {
    content: '\e801';
    font-family: 'fontello';
    font-size: 27px;
}

#sidebar-treeview #main-treeview .icon-microchip::before {
    content: '\e806';
}

#sidebar-treeview #main-treeview .icon-thumbs-up-alt::before {
    content: '\e805';
}

#sidebar-treeview #main-treeview .icon-docs::before {
    content: '\e802';
}

#sidebar-treeview #main-treeview .icon-th::before {
    content: '\e803';
}

#sidebar-treeview #main-treeview .icon-code::before {
    content: '\e804';
}

#sidebar-treeview #main-treeview .icon-chrome::before {
    content: '\e807';
}

#sidebar-treeview #main-treeview .icon-up-hand::before {
    content: '\e810';
}

#sidebar-treeview #main-treeview .icon-bookmark-empty::before {
    content: '\e811';
}

#sidebar-treeview #main-treeview .icon-help-circled::before {
    content: '\e813';
}

#sidebar-treeview #main-treeview .icon-doc-text::before {
    content: '\e812';
}

#sidebar-treeview #main-treeview .icon-circle-thin::before {
    content: '\e808';
}
.e-sidebar.e-open #main-treeview .e-text-content {
    padding: 0 0 0 24px;
}
.e-sidebar.e-close #main-treeview .e-text-content {
    padding: 0 0 0 8px;
}
#main-treeview ul {
    overflow:inherit;
}
Copied to clipboard
import * as React from 'react';
import { SidebarComponent,  TreeViewComponent, TreeView } from '@syncfusion/ej2-react-navigations';
import { enableRipple } from '@syncfusion/ej2-base';

function App() {
    let sidebarobj: SidebarComponent;
    let treeviewobj: TreeViewComponent;
    let data: any = [
        {
            nodeId: '01', nodeText: 'Installation', iconCss: 'icon-microchip icon',
            nodeChild: [
                { nodeId: '05-01', nodeText: 'Calendar', iconCss: 'icon-circle-thin icon' },
                { nodeId: '05-02', nodeText: 'DatePicker', iconCss: 'icon-circle-thin icon' },
                { nodeId: '05-03', nodeText: 'DateTimePicker', iconCss: 'icon-circle-thin icon' },
                { nodeId: '05-04', nodeText: 'DateRangePicker', iconCss: 'icon-circle-thin icon' },
                { nodeId: '05-05', nodeText: 'TimePicker', iconCss: 'icon-circle-thin icon' },
                { nodeId: '05-06', nodeText: 'SideBar', iconCss: 'icon-circle-thin icon' }
            ]
        },
        {
            nodeId: '02', nodeText: 'Deployment', iconCss: 'icon-thumbs-up-alt icon',
        },
        {
            nodeId: '03', nodeText: 'Quick Start', iconCss: 'icon-docs icon',
        },
        {
            nodeId: '04', nodeText: 'Components', iconCss: 'icon-th icon',
            nodeChild: [
                { nodeId: '04-01', nodeText: 'Calendar', iconCss: 'icon-circle-thin icon' },
                { nodeId: '04-02', nodeText: 'DatePicker', iconCss: 'icon-circle-thin icon' },
                { nodeId: '04-03', nodeText: 'DateTimePicker', iconCss: 'icon-circle-thin icon' },
                { nodeId: '04-04', nodeText: 'DateRangePicker', iconCss: 'icon-circle-thin icon' },
                { nodeId: '04-05', nodeText: 'TimePicker', iconCss: 'icon-circle-thin icon' },
                { nodeId: '04-06', nodeText: 'SideBar', iconCss: 'icon-circle-thin icon' }
            ]
        },
        {
            nodeId: '05', nodeText: 'API Reference', iconCss: 'icon-code icon',
            nodeChild: [
                { nodeId: '05-01', nodeText: 'Calendar', iconCss: 'icon-circle-thin icon' },
                { nodeId: '05-02', nodeText: 'DatePicker', iconCss: 'icon-circle-thin icon' },
                { nodeId: '05-03', nodeText: 'DateTimePicker', iconCss: 'icon-circle-thin icon' },
                { nodeId: '05-04', nodeText: 'DateRangePicker', iconCss: 'icon-circle-thin icon' },
                { nodeId: '05-05', nodeText: 'TimePicker', iconCss: 'icon-circle-thin icon' },
                { nodeId: '05-06', nodeText: 'SideBar', iconCss: 'icon-circle-thin icon' }
            ]
        },
        {
            nodeId: '06', nodeText: 'Browser Compatibility', iconCss: 'icon-chrome icon'
        },
        {
            nodeId: '07', nodeText: 'Upgrade Packages', iconCss: 'icon-up-hand icon'
        },
        {
            nodeId: '08', nodeText: 'Release Notes', iconCss: 'icon-bookmark-empty icon'
        },
        {
            nodeId: '09', nodeText: 'FAQ', iconCss: 'icon-help-circled icon'
        },
        {
            nodeId: '10', nodeText: 'License', iconCss: 'icon-doc-text icon'
        }
    ];

    let width: string = '290px';
    let target: string = '.main-content';
    let mediaQuery: string = '(min-width: 600px)';
    let dockSize: string ="44px";
    let fields: object = { dataSource: data, id: 'nodeId', text: 'nodeText', child: 'nodeChild' };
    function onCreate(): void  {
        sidebarobj.element.style.visibility = '';
    }
    function onClose(): void {
        treeviewobj.collapseAll();
    }
    function toggleClick():void {
        if(sidebarobj.isOpen)
        {
            sidebarobj.hide();
            treeviewobj.collapseAll();
        }
        else {
            sidebarobj.show();
            treeviewobj.expandAll();
        }  
    }
    let sidbarToggle = null;
    return (
        // Sidebar Element Declaration
        <div className="control-section">
            <div id="wrapper">
                <title>Essential JS 2 for React - Sidebar {'>'} Sidebar with ListView </title>
                <div className="col-lg-12 col-sm-12 col-md-12">
                    <div className='main-header' id='header-section'>
                        <ul className='header-list'>
                            <li className='float-left header-style icon-menu' id='hamburger' onClick={toggleClick} ref={sidebar=>(sidbarToggle as any)=sidebar}></li>
                            <li className='float-left header-style nav-pane'><b>Navigation Pane</b></li>
                            <li className='header-style float-right support border-left'><b>Support</b></li>
                        </ul>
                    </div>
                    <SidebarComponent id="sidebar-treeview" ref={Sidebar => sidebarobj = Sidebar as SidebarComponent} width={width} target={target} mediaQuery={mediaQuery} style={{visibility:"hidden"}} created={onCreate} close={onClose} dockSize={dockSize} enableDock={true}>
                        <div className='main-menu'>
                            <div>
                                <TreeViewComponent id='main-treeview' ref={Treeview => treeviewobj = Treeview as TreeViewComponent}fields={fields} expandOn='Click' />
                            </div>
                        </div>
                    </SidebarComponent>
                    <div className="main-content" id="main-text">
                        <div className='sidebar-content'>
                                <h2 className='sidebar-heading'> Responsive Sidebar With Treeview</h2>
                                <p className='paragraph-content'> This is a graphical aid for visualising and categorising the site,
                                in the style of an expandable and collapsable treeview component. It auto-expands to display the node(s),
                                if any, corresponding to the currently viewed title, highlighting that node(s) and its ancestors.
                                Load-on-demand when expanding nodes is available where supported (most graphical browsers), falling
                                back to a full-page reload. MediaWiki-supported caching, aside from squid, has been considered so
                                that unnecessary re-downloads of content are avoided where possible. The complete expanded/collapsed
                                state of the treeview persists across page views in most situations.</p>
                                <p className='paragraph-content'>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
                                    eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
                                    nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
                                    dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
                                    Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim
                                    id est laborum.</p>
                                <div className='line'></div>
                                <h2 className='sidebar-heading'>Lorem Ipsum Dolor</h2>
                                <p className='paragraph-content'>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
                                    eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
                                    nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
                                    dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>
                                <div className='line'></div>
                                <h2 className='sidebar-heading'> Lorem Ipsum Dolor</h2>
                                <p className='paragraph-content'>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
                                    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
                                    exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
                                    reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
                                    occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
                                <div className='line'></div>
                                <h2 className='sidebar-heading'> Lorem Ipsum Dolor</h2>
                                <p className='paragraph-content'>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
                                    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
                                    exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
                                    reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
                                    occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    )
}
export default App;
Copied to clipboard
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import App  from './App';

ReactDOM.render(<App />, document.getElementById('sample'));