Getting Started
8 May 2025
24 minutes to read
The following section explains the required steps to build the simple
Sidebar
component with its basic usage in step by step procedure.
Dependencies
The following list of dependencies are required to use the Sidebar component in your application.
|-- @syncfusion/ej2-react-navigations
|-- @syncfusion/ej2-base
|-- @syncfusion/ej2-data
|-- @syncfusion/ej2-react-base
|-- @syncfusion/ej2-navigations
|-- @syncfusion/ej2-inputs
|-- @syncfusion/ej2-splitbuttons
|-- @syncfusion/ej2-lists
|-- @syncfusion/ej2-popups
|-- @syncfusion/ej2-buttons
Installation and configuration
To easily set up a React application, use
create-vite-app
, which provides a faster development environment, smaller bundle sizes, and optimized builds compared to traditional tools like
create-react-app
. For detailed steps, refer to the Vite
installation instructions
. Vite sets up your environment using JavaScript and optimizes your application for production.
Note:
To create a React application using
create-react-app
, refer to this
documentation
for more details.
To create a new React application, run the following command.
npm create vite@latest my-app
To set-up a React application in TypeScript environment, run the following command.
npm create vite@latest my-app -- --template react-ts
cd my-app
npm run dev
To set-up a React application in JavaScript environment, run the following command.
npm create vite@latest my-app -- --template react
cd my-app
npm run dev
Adding Syncfusion
®
packages
All the available Essential
®
JS 2 packages are published in
npmjs.com
public registry. You can choose the component that you want to install. For this application, we are going to use
Sidebar
component.
To install Sidebar component, use the following command
npm install @syncfusion/ej2-react-navigations --save
Adding Style sheet to the Application
To render the Sidebar component, need to import Sidebar and its dependent component’s styles as given below in
App.css
.
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-react-navigations/styles/material.css";
Note: If you want to refer the combined component styles, please make use of our
CRG
(Custom Resource Generator) in your application.
Sidebar can be initialized using the
<SidebarComponent>
tag, it’s used to render Sidebar as it contains primary content aside from the main content. The immediate sibling element of the Sidebar will be considered as the main content.
To include the Sidebar component in application import the
SidebarComponent
from
ej2-react-navigations
package in
App.tsx
.
Then add the Sidebar component as shown in below code example.
src/App.tsx
import { SidebarComponent } from '@syncfusion/ej2-react-navigations';
import * as React from 'react';
function App() {
return (
<div className="control-section">
<div id="wrapper">
<SidebarComponent id="default-sidebar">
<div className="title"> Sidebar content</div>
</SidebarComponent>
<div className="content">
<div className="title">Main content</div>
<div className="sub-title"> content goes here</div>
export default App;
import { SidebarComponent } from '@syncfusion/ej2-react-navigations';
import * as React from 'react';
function App() {
return (<div className="control-section">
<div id="wrapper">
<SidebarComponent id="default-sidebar">
<div className="title"> Sidebar content</div>
</SidebarComponent>
<div className="content">
<div className="title">Main content</div>
<div className="sub-title"> content goes here</div>
</div>);
export default App;
Run the application
Now run the
npm run dev
command in the console to start the development server. This command compiles your code and serves the application locally, opening it in the browser.
npm run dev
The following sample, shows the basic Sidebar component.
import { SidebarComponent } from '@syncfusion/ej2-react-navigations';
import * as React from 'react';
function App() {
let sidebarObj;
function onCreate() {
sidebarObj.element.style.visibility = '';
return (<div className="control-section">
<div id="wrapper">
{/* Initializing the Sidebar component */}
<SidebarComponent id="default-sidebar" ref={Sidebar => sidebarObj = Sidebar} created={onCreate} style={{ visibility: "hidden" }}>
<div className="title"> Sidebar content</div>
</SidebarComponent>
<div className="content">
<div className="title">Main content</div>
<div className="sub-title"> content goes here</div>
</div>);
export default App;
import { SidebarComponent } from '@syncfusion/ej2-react-navigations';
import * as React from 'react';
function App() {
let sidebarObj: SidebarComponent;
function onCreate():void {
sidebarObj.element.style.visibility='';
return (
<div className="control-section">
<div id="wrapper">
{/* Initializing the Sidebar component */}
<SidebarComponent id="default-sidebar" ref={Sidebar => sidebarObj = Sidebar as SidebarComponent} created={onCreate} style={{visibility:"hidden"
}}>
<div className="title"> Sidebar content</div>
</SidebarComponent>
<div className="content">
<div className="title">Main content</div>
<div className="sub-title"> content goes here</div>
export default App;
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(<App />, document.getElementById('sample'));
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(<App />, document.getElementById('sample'));
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-react-navigations/styles/material.css";
.title {
text-align: center;
font-size: 20px;
padding: 15px;
.sub-title {
text-align: center;
font-size: 16px;
padding: 10px;
#wrapper {
display: block;
#default-sidebar {
background-color: rgb(25, 118, 210);
color: #ffffff;
<!DOCTYPE html>
<html lang="en">
<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="https://cdn.syncfusion.com/ej2/31.1.17/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/31.1.17/ej2-react-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/31.1.17/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>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<div id='sample'>
<div id='loader'>Loading....</div>
</body>
</html>
Enable backdrop
Enabling the showBackdrop in the Sidebar component will prevent the main content from user interactions.
Here, DOM elements will not get changed. It only closes the main content by covering with a black backdrop overlay and focuses the Sidebar in the screen. Sidebar can be rendered with specific width by setting width property.
To achieve a proper backdrop, we suggest that you create a wrapper parent container for the div block in which you intend to enable the backdrop. Set the class name of this parent container as the target for the Sidebar. Alternatively, you can place an empty div container after the target container.
import { ButtonComponent } from '@syncfusion/ej2-react-buttons';
import { SidebarComponent } from '@syncfusion/ej2-react-navigations';
import * as React from 'react';
function App() {
let sidebarObj;
let type = "Push";
let showBackdrop = true;
function onCreate() {
sidebarObj.element.style.visibility = '';
// Toggle(Open/Close) the Sidebar
function toggleClick() {
sidebarObj.toggle();
// Close the Sidebar
function closeClick() {
sidebarObj.hide();
return (<div className="control-section">
<div id="wrapper">
{/* Initializing the Sidebar component */}
<SidebarComponent id="default-sidebar" ref={Sidebar => sidebarObj = Sidebar} style={{ visibility: "hidden" }} created={onCreate} showBackdrop={showBackdrop} type={type} width="280px">
<div className="title"> Sidebar content</div>
<div className="sub-title">
Click the button to close the Sidebar.
<div className="center-align">
<ButtonComponent onClick={closeClick} id="close" className="e-btn close-btn">Close Sidebar</ButtonComponent>
</SidebarComponent>
<div className="title">Main content</div>
<div className="sub-title"> Click the button to open/close the Sidebar.</div>
<div className="center-align">
<ButtonComponent onClick={toggleClick} id="toggle" className="e-btn e-info">Toggle Sidebar</ButtonComponent>
</div>);
export default App;
import { ButtonComponent }
from '@syncfusion/ej2-react-buttons';
import { SidebarComponent, SidebarType } from '@syncfusion/ej2-react-navigations';
import * as React from 'react';
function App(){
let sidebarObj: SidebarComponent;
let type: SidebarType = "Push";
let showBackdrop: boolean = true;
function onCreate(): void {
sidebarObj.element.style.visibility='';
// Toggle(Open/Close) the Sidebar
function toggleClick(): void {
sidebarObj.toggle();
// Close the Sidebar
function closeClick(): void {
sidebarObj.hide();
return (
<div className="control-section">
<div id="wrapper">
{/* Initializing the Sidebar component */}
<SidebarComponent id="default-sidebar" ref={Sidebar => sidebarObj = Sidebar as SidebarComponent} style={{visibility:"hidden"}} created={onCreate} showBackdrop={showBackdrop} type={type} width="280px">
<div className="title"> Sidebar content</div>
<div className="sub-title">
Click the button to close the Sidebar.
<div className="center-align">
<ButtonComponent onClick={closeClick} id="close" className="e-btn close-btn">Close Sidebar</ButtonComponent>
</SidebarComponent>
<div className="title">Main content</div>
<div className="sub-title"> Click the button to open/close the Sidebar.</div>
<div className="center-align">
<ButtonComponent onClick={toggleClick} id="toggle" className="e-btn e-info">Toggle Sidebar</ButtonComponent>
export default App;
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(<App />, document.getElementById('sample'));
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(<App />, document.getElementById('sample'));
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-react-buttons/styles/material.css";
@import "../node_modules/@syncfusion/ej2-react-navigations/styles/material.css";
.center-align {
text-align: center;
padding: 20px;
.title {
text-align: center;
font-size: 20px;
padding: 15px;
.sub-title {
text-align: center;
font-size: 16px;
padding: 10px;
#wrapper {
display: block;
#default-sidebar {
background-color: rgb(25, 118, 210);
color: #ffffff;
<!DOCTYPE html>
<html lang="en">
<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="https://cdn.syncfusion.com/ej2/31.1.17/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/31.1.17/ej2-react-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/31.1.17/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>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<div id='sample'>
<div id='loader'>Loading....</div>
</body>
</html>
Position
Positioning the Sidebar to the right or left of the main content can be achieved by using the position property. If the position is not set, the Sidebar will expand from the left to the body element. enablePersistence will persist the component’s state between page reloads. The change event will be triggered when the state(expand/collapse) of the component is changed.
import { ButtonComponent, RadioButtonComponent } from '@syncfusion/ej2-react-buttons';
import { SidebarComponent } from '@syncfusion/ej2-react-navigations';
import * as React from 'react';
function App() {
let sidebarObj;
let btnObj;
let type = "Push";
function onCreate() {
sidebarObj.element.style.visibility = '';
// Toggle button click event handler
function btnClick() {
if (btnObj.element.classList.contains('e-active')) {
btnObj.content = 'Close';
btnObj.iconCss = 'e-icons burg-icon';
sidebarObj.show();
else {
btnObj.content = 'Open';
btnObj.iconCss = 'e-icons burg-icon';
sidebarObj.hide();
// Toggle(Open/Close) the Sidebar
function toggleClick() {
sidebarObj.toggle();
// Close the Sidebar
function closeClick() {
sidebarObj.hide();
btnObj.content = 'Open';
// function to handle the CheckBox change event
function onChange(args) {
sidebarObj.position = (args.event.target.id === "left") ? "Left" : "Right";
return (<div className="control-section">
<div id="wrapper">
{/* Initializing the Sidebar component */}
<SidebarComponent id="default-sidebar" enablePersistence={true} ref={Sidebar => sidebarObj = Sidebar} style={{ visibility: "hidden" }} created={onCreate} type={type} width="280px">
<div className="title"> Sidebar content</div>
<div className="sub-title"> Click the button to close the Sidebar. </div>
<div className="center-align">
<ButtonComponent onClick={closeClick} id="close" className="e-btn close-btn">Close Sidebar</ButtonComponent>
</SidebarComponent>
<div id="head">
<ButtonComponent id="toggle" ref={(scope) => { btnObj = scope; }} iconCss='e-icons burg-icon' isToggle={true} onClick={btnClick} className="e-btn e-info">Open</ButtonComponent>
<div id="maincontent" className="content">
<div className="title">Main content</div>
<div className="radiobutton">
<div className='row'>
<RadioButtonComponent id="left" checked={true} label='Left' name='position' change={onChange}/>
<div className='row'>
<RadioButtonComponent id="right" label='Right' name='position' change={onChange}/>
</div>);
export default App;
import { ButtonComponent, ChangeEventArgs, RadioButtonComponent } from '@syncfusion/ej2-react-buttons';
import { SidebarComponent, SidebarType } from '@syncfusion/ej2-react-navigations';
import * as React from 'react';
function App() {
let sidebarObj: SidebarComponent;
let btnObj: ButtonComponent;
let type: SidebarType = "Push";
function onCreate(): void {
sidebarObj.element.style.visibility='';
// Toggle button click event handler
function btnClick(): void {
if (btnObj.element.classList.contains('e-active')) {
btnObj.content = 'Close';
btnObj.iconCss = 'e-icons burg-icon';
sidebarObj.show();
} else {
btnObj.content = 'Open';
btnObj.iconCss = 'e-icons burg-icon';
sidebarObj.hide();
// Toggle(Open/Close) the Sidebar
function toggleClick(): void {
sidebarObj.toggle();
// Close the Sidebar
function closeClick(): void {
sidebarObj.hide();
btnObj.content = 'Open';
// function to handle the CheckBox change event
function onChange(args: ChangeEventArgs): void {
sidebarObj.position = ((args as any).event.target.id === "left") ? "Left" : "Right";
return (
<div className="control-section">
<div id="wrapper">
{/* Initializing the Sidebar component */}
<SidebarComponent id="default-sidebar" enablePersistence={true} ref={Sidebar => sidebarObj = Sidebar as SidebarComponent} style={{visibility:"hidden"}} created={onCreate} type={type} width="280px">
<div className="title"> Sidebar content</div>
<div className="sub-title"> Click the button to close the Sidebar. </div>
<div
className="center-align">
<ButtonComponent onClick={closeClick} id="close" className="e-btn close-btn">Close Sidebar</ButtonComponent>
</SidebarComponent>
<div id="head">
<ButtonComponent id="toggle" ref={(scope) => { btnObj = scope as ButtonComponent; }} iconCss='e-icons burg-icon'
isToggle={true} onClick={btnClick} className="e-btn e-info">Open</ButtonComponent>
<div id="maincontent" className="content">
<div className="title">Main content</div>
<div className="radiobutton" >
<div className='row'>
<RadioButtonComponent id="left" checked={true} label='Left' name='position' change={onChange} />
<div className='row'>
<RadioButtonComponent id="right" label='Right' name='position' change={onChange} />
export default App;
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(<App />, document.getElementById('sample'));
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(<App />, document.getElementById('sample'));
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-react-buttons/styles/material.css";
@import "../node_modules/@syncfusion/ej2-react-navigations/styles/material.css";
.center-align {
text-align: center;
padding: 20px;
.title {
text-align: center;
font-size: 20px;
padding: 15px;
.sub-title {
text-align: center;
font-size: 16px;
padding: 10px;
#head {
border: 1px solid #424242;
border-bottom-color: transparent;
background: #00897b;
#toggle {
/* csslint allow: adjoining-classes*/
background: #00695c;
box-shadow: none;
border-radius: 0;
height: 39px;
.burg-icon:before {
content: '\e10d';
font-size: 16px;
font-family: 'e-position-icons';
.content {
height: 358px;
border: 1px solid grey;
.radiobutton {
text-align: center;
.control-section .content .radiobutton .row {
padding: 10px;
display: inline-block;
margin: 0;
#default-sidebar {
background-color: #26a69a;
color: #ffffff;
#wrapper {
display: block;
body {
margin: 0 !important;
@font-face {
font-family: 'e-position-icons';
src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAAKAIAAAwAgT1MvMjciQ6oAAAEoAAAAVmNtYXBH1Ec8AAABsAAAAHJnbHlmKcXfOQAAAkAAAAg4aGVhZBLt+DYAAADQAAAANmhoZWEHogNsAAAArAAAACRobXR4LvgAAAAAAYAAAAAwbG9jYQukCgIAAAIkAAAAGm1heHABGQEOAAABCAAAACBuYW1lR4040wAACngAAAJtcG9zdEFgIbwAAAzoAAAArAABAAADUv9qAFoEAAAA//UD8wABAAAAAAAAAAAAAAAAAAAADAABAAAAAQAAlbrm7l8PPPUACwPoAAAAANfuWa8AAAAA1+5ZrwAAAAAD8wPzAAAACAACAAAAAAAAAAEAAAAMAQIAAwAAAAAAAgAAAAoACgAAAP8AAAAAAAAAAQPqAZAABQAAAnoCvAAAAIwCegK8AAAB4AAxAQIAAAIABQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUGZFZABA4QLhkANS/2oAWgPzAJYAAAABAAAAAAAABAAAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAAAAAAgAAAAMAAAAUAAMAAQAAABQABABeAAAADgAIAAIABuEC4QnhD+ES4RvhkP//AADhAuEJ4QvhEuEa4ZD//wAAAAAAAAAAAAAAAAABAA4ADgAOABYAFgAYAAAAAQACAAYABAADAAgABwAKAAkABQALAAAAAAAAAB4AQABaAQYB5gJkAnoCjgKwA8oEHAAAAAIAAAAAA+oDlQAEAAoAAAEFESERCQEVCQE1AgcBZv0mAXQB5P4c/g4Cw/D+lwFpAcP+s24BTf6qbgAAAAEAAAAAA+oD6gALAAATCQEXCQ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G0AZQB0AHIAbwBlAC0AaQBjAG8AbgBzAC0AbQBlAHQAcgBvAFYAZQByAHMAaQBvAG4AIAAxAC4AMABlAC0AaQBjAG8AbgBzAC0AbQBlAHQAcgBvAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAHUAcwBpAG4AZwAgAFMAeQBuAGMAZgB1AHMAaQBvAG4AIABNAGUAdAByAG8AIABTAHQAdQBkAGkAbwB3AHcAdwAuAHMAeQBuAGMAZgB1AHMAaQBvAG4ALgBjAG8AbQAAAAACAAAAAAAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwBAgEDAQQBBQEGAQcBCAEJAQoBCwEMAQ0AB2hvbWUtMDELQ2xvc2UtaWNvbnMHbWVudS0wMQR1c2VyB0JUX2luZm8PU2V0dGluZ19BbmRyb2lkDWNoZXZyb24tcmlnaHQMY2hldnJvbi1sZWZ0CE1UX0NsZWFyDE1UX0p1bmttYWlscwRzdG9wAAA=) format('truetype');
font-weight: normal;
font-style: normal;
<!DOCTYPE html>
<html lang="en">
<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="https://cdn.syncfusion.com/ej2/31.1.17/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/31.1.17/ej2-react-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/31.1.17/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>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<div id='sample'>
<div id='loader'>Loading....</div>
</body>
</html>
import { ButtonComponent } from '@syncfusion/ej2-react-buttons';
import { SidebarComponent } from '@syncfusion/ej2-react-navigations';
import * as React from 'react';
function App() {
let sidebarObj;
let type = "Push";
function onCreate() {
sidebarObj.element.style.visibility = '';
// Toggle(Open/Close) the Sidebar
function toggleClick() {
sidebarObj.toggle();
// Close the Sidebar
function closeClick() {
sidebarObj.hide();
return (<div className="control-section">
<div id="wrapper">
{/* Initializing the Sidebar component */}
<SidebarComponent id="default-sidebar" animate={false} enableRtl={true} type={type} ref={Sidebar => sidebarObj = Sidebar} created={onCreate} style={{ visibility: "hidden" }}>
<div className="title"> Sidebar content</div>
<div className="sub-title">
Click the button to close the Sidebar
<div className="center-align">
<ButtonComponent onClick={closeClick} id="close" className="e-btn close-btn">Close Sidebar</ButtonComponent>
</SidebarComponent>
<div className="title">Main content</div>
<div className="sub-title"> Click the button to open/close the Sidebar.</div>
<div className="center-align">
<ButtonComponent onClick={toggleClick} id="toggle" className="e-btn e-info">Toggle Sidebar</ButtonComponent>
</div>);
export default App;
import { ButtonComponent } from '@syncfusion/ej2-react-buttons';
import { SidebarComponent, SidebarType } from '@syncfusion/ej2-react-navigations';
import * as React from 'react';
function App() {
let sidebarObj: SidebarComponent;
let type: SidebarType = "Push";
function onCreate():void {
sidebarObj.element.style.visibility='';
// Toggle(Open/Close) the Sidebar
function toggleClick(): void {
sidebarObj.toggle();
// Close the Sidebar
function closeClick(): void {
sidebarObj.hide();
return (
<div className="control-section">
<div id="wrapper">
{/* Initializing the Sidebar component */}
<SidebarComponent id="default-sidebar" animate={false} enableRtl={true} type={type} ref={Sidebar => sidebarObj = Sidebar as SidebarComponent} created={onCreate} style={{visibility:"hidden"}} >
<div className="title"> Sidebar content</div>
<div className="sub-title">
Click the button to close the Sidebar
<div className="center-align">
<ButtonComponent onClick={closeClick} id="close" className="e-btn close-btn">Close Sidebar</ButtonComponent>
</SidebarComponent>
<div className="title">Main content</div>
<div className="sub-title"> Click the button to open/close the Sidebar.</div>
<div className="center-align">
<ButtonComponent onClick={toggleClick} id="toggle" className="e-btn e-info">Toggle Sidebar
</ButtonComponent>
export default App;
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(<App />, document.getElementById('sample'));
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(<App />, document.getElementById('sample'));
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-buttons/styles/material.css";
@import "../node_modules/@syncfusion/ej2-react-navigations/styles/material.css";
.center-align {
text-align: center;
padding: 20px;
.title {
text-align: center;
font-size: 20px;
padding: 15px;
.sub-title {
text-align: center;
font-size: 16px;
padding: 10px;
#wrapper {
display: block;
#close:hover,
#close:active,
#close:focus {
background: white;
color: black;
#default-sidebar {
background-color: rgb(25, 118, 210);
color: #ffffff;
<!DOCTYPE html>
<html lang="en">
<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="https://cdn.syncfusion.com/ej2/31.1.17/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/31.1.17/ej2-react-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/31.1.17/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>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<div id='sample'>
<div id='loader'>Loading....</div>
</body>
</html>
import { ButtonComponent } from '@syncfusion/ej2-react-buttons';
import { SidebarComponent } from '@syncfusion/ej2-react-navigations';
import * as React from 'react';
function App() {
let sidebarObj;
let type = "Push";
function onCreate() {
sidebarObj.element.style.visibility = '';
// Toggle(Open/Close) the Sidebar
function toggleClick() {
sidebarObj.show();
return (<div className="control-section">
<div id="wrapper">
{/* Initializing the Sidebar component */}
<SidebarComponent id="default-sidebar" ref={Sidebar => sidebarObj = Sidebar} closeOnDocumentClick={true} type={type} created={onCreate} isOpen={true} style={{ visibility: "hidden" }}>
<div className="title"> Sidebar content</div>
</SidebarComponent>
<div className="title">Main content</div>
<div className="sub-title"> Click the button to open the Sidebar.</div>
<div className="center-align">
<ButtonComponent onClick={toggleClick} id="toggle" className="e-btn e-info">Open Sidebar</ButtonComponent>
</div>);
export default App;
import { ButtonComponent } from '@syncfusion/ej2-react-buttons';
import { SidebarComponent, SidebarType } from '@syncfusion/ej2-react-navigations';
import * as React from 'react';
function App() {
let sidebarObj: SidebarComponent;
let type: SidebarType = "Push";
function onCreate():void {
sidebarObj.element.style.visibility='';
// Toggle(Open/Close) the Sidebar
function toggleClick(): void {
sidebarObj.show();
return (
<div className="control-section">
<div id="wrapper">
{/* Initializing the Sidebar component */}
<SidebarComponent id="default-sidebar" ref={Sidebar => sidebarObj =
Sidebar as SidebarComponent} closeOnDocumentClick={true} type={type} created={onCreate} isOpen={true} style={{visibility:"hidden"}} >
<div className="title"> Sidebar content</div>
</SidebarComponent>
<div className="title">Main content</div>
<div className="sub-title"> Click the button to open the Sidebar.</div>
<div className="center-align">
<ButtonComponent onClick={toggleClick} id="toggle" className="e-btn e-info">Open Sidebar</ButtonComponent>
export default App;
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(<App />, document.getElementById('sample'));
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(<App />, document.getElementById('sample'));
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-buttons/styles/material.css";
@import "../node_modules/@syncfusion/ej2-react-navigations/styles/material.css";
.center-align {
text-align: center;
padding: 20px;
.title {
text-align: center;
font-size: 20px;
padding: 15px;
.sub-title {
text-align: center;
font-size: 16px;
padding: 10px;
#wrapper {
display: block;
body {
margin: 0;
#default-sidebar {
background-color: rgb(25, 118, 210);
color: #ffffff;
<!DOCTYPE html>
<html lang="en">
<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="https://cdn.syncfusion.com/ej2/31.1.17/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/31.1.17/ej2-react-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/31.1.17/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>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<div id='sample'>
<div id='loader'>Loading....</div>
</body>
</html>
import { ButtonComponent } from '@syncfusion/ej2-react-buttons';
import { SidebarComponent } from '@syncfusion/ej2-react-navigations';
import * as React from 'react';
function App() {
let sidebarObj;
let type = "Push";
function onCreate() {
sidebarObj.element.style.visibility = '';
// Toggle(Open/Close) the Sidebar
function toggleClick() {
sidebarObj.toggle();
// Close the Sidebar
function closeClick() {
sidebarObj.hide();
return (<div className="control-section">
<div id="wrapper">
{/* Initializing the Sidebar component */}
<SidebarComponent id="default-sidebar" enableGestures={false} type={type} ref={Sidebar => sidebarObj = Sidebar} created={onCreate} style={{ visibility: "hidden" }}>
<div className="title"> Sidebar content</div>
<div className="sub-title">
Click the button to close the Sidebar.
<div className="center-align">
<ButtonComponent onClick={closeClick} id="close" className="e-btn close-btn">Close Sidebar</ButtonComponent>
</SidebarComponent>
<div className="title">Main content</div>
<div className="sub-title"> Click the button to open/close the Sidebar.</div>
<div className="center-align">
<ButtonComponent onClick={toggleClick} id="toggle" className="e-btn e-info">Toggle Sidebar</ButtonComponent>
</div>);
export default App;
import { ButtonComponent } from '@syncfusion/ej2-react-buttons';
import { SidebarComponent, SidebarType } from '@syncfusion/ej2-react-navigations';
import * as React from 'react';
function App() {
let sidebarObj: SidebarComponent;
let type: SidebarType = "Push";
function onCreate():void {
sidebarObj.element.style.visibility='';
// Toggle(Open/Close) the Sidebar
function toggleClick(): void {
sidebarObj.toggle();
// Close the Sidebar
function closeClick(): void {
sidebarObj.hide();
return (
<div className="control-section">
<div id="wrapper">
{/* Initializing the Sidebar component */}
<SidebarComponent id="default-sidebar" enableGestures={false} type={type} ref={Sidebar => sidebarObj = Sidebar as SidebarComponent} created={onCreate} style={{visibility:"hidden"}} >
<div className="title"> Sidebar content</div>
<div className="sub-title">
Click the button to close the Sidebar.
<div className="center-align">
<ButtonComponent onClick={closeClick} id="close" className="e-btn close-btn">Close Sidebar</ButtonComponent>
</SidebarComponent>
<div className="title">Main content</div>
<div className="sub-title"> Click the button to open/close the Sidebar.</div>
<div className="center-align">
<ButtonComponent onClick={toggleClick} id="toggle" className="e-btn e-info">Toggle Sidebar</ButtonComponent>
export default App;
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(<App />, document.getElementById('sample'));
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(<App />, document.getElementById('sample'));
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-buttons/styles/material.css";
@import "../node_modules/@syncfusion/ej2-react-navigations/styles/material.css";
.center-align {
text-align: center;
padding: 20px;
.title {
text-align: center;
font-size: 20px;
padding: 15px;
.sub-title {
text-align: center;
font-size: 16px;
padding: 10px;
#wrapper {
display: block;
#close:hover,
#close:active,
#close:focus {
background:white;
color:black;
body {
margin: 0;
#default-sidebar {
background-color: rgb(25, 118, 210);
color: #ffffff;
<!DOCTYPE html>
<html lang="en">
<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="https://cdn.syncfusion.com/ej2/31.1.17/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/31.1.17/ej2-react-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/31.1.17/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>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<div id='sample'>
<div id='loader'>Loading....</div>
</body>
</html>