content logo

React Sidebars:

React Sidebar Menu with Fade Effect

Menus are inseparable items in any kind of website, and it is better to use them to have a better page. The React Sidebar Menu with Fade Effect is one of the most attractive codes you can use on your website easily. This React JS Sidebar Menu is used to classify different contents of a website into several items. So, we recommend you to use this HTML Fading Menu in order to change the design of your website and classify all contents into different subcategories a.

There is a preview of this Free Javascript Menu Code that you can look at its design. As you can see below, this Sidebar Menu Code has a light background, and it is so perfect for colorful websites. There is a circle on the corner of the page which contains a plus icon. When you click this icon, you will face a white page with a fading effect. This page includes different categories that are separated with some black lines. When you put the mouse's cursor on these categories, the colors change to gray. The exit button is placed above the Sidebar Menu Effect in green color. When you click on this icon, it will move to the first page.

#

React JS Sidebar Menu

#

Sidebar Menu Code

#

HTML Fading Menu

#

Free Javascript Menu Code

#

Sidebar Menu Effect

<!-- This script got from frontendfreecode.com -->
<div id="menu">
</div><a style="font-size: 8pt; text-decoration: none" target="_blank" href="http://frontendfreecode.com">Free Frontend</a>
                                                                            
body {
	background: rgba(241, 206, 184, 1);
	background: -webkit-linear-gradient( -45deg, rgba(241, 206, 184, 1) 0%, rgba(142, 186, 163, 1) 100%);
	font-family: "helvetica neue", helvetica;
	font-weight: light;
	height: 100%;
	margin: 0;
	background-repeat: no-repeat;
	background-attachment: fixed;
}
.menu-wrapper {
	height: 600px;
	width: 250px;
	background-color: rgba(255, 255, 255, .8);
	margin-left: -450px;
	margin-top: -10px;
	opacity: 0;
	-webkit-box-shadow: 10px 10px 6px -8px rgba(161, 136, 119, .7);
	transition: all .3s ease-in-out;
	border-radius: 2px;
	padding: 0 auto;
	border-right: 1px solid rgba(0, 0, 0, .2);
	border-bottom: 1px solid rgba(0, 0, 0, .2);
}
.menu-open {
	margin-left: 0px;
	opacity: 1;
}
.menu-toggle {
	cursor: pointer;
	position: absolute;
	z-index: 1000;
	top: 0;
	margin: 20px;
	padding: 0px;
	height: 50px;
	width: 50px;
	font-size: 20px;
	color: rgba(0, 0, 0, .5);
	font-weight: bold;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, .8);
	transform: rotate(0deg);
	transition: all .2s ease-in;
	border: 0 none;
}
.menu-toggle:hover {
	cursor: pointer;
	transform: scale(1.1) rotate(0deg);
	-webkit-box-shadow: 10px 2px 8px -8px rgba(179, 164, 139, .6);
}
.menu-toggle:focus {
	cursor: pointer;
	outline: 0 none;
}
.close-button {
	cursor: pointer;
	transform: rotate(45deg);
	background-color: rgba(109, 163, 140, 1);
	-webkit-box-shadow: 10px 2px 8px -8px rgba(179, 164, 139, .6);
}
.close-button:hover {
	transform: scale(1.1) rotate(45deg);
}
.links-wrapper {
	margin: 10px;
	padding: 10px;
	text-align: right;
	opacity: 1;
	transition: all .7s ease-out;
	transition-delay: .3s;
	letter-spacing: 2px;
}
.links-wrapper-closed {
	padding-top: 50px;
	opacity: 0;
	letter-spacing: 0px;
}
.link-list {
	padding-top: 90px;
	padding-right: 25px;
	padding-left: 25px;
}
.link-list li {
	list-style-type: none;
	text-transform: uppercase;
	margin: 0;
	margin-bottom: 30px;
	border-bottom: 2px solid rgba(0, 0, 0, .5);
	padding: 3px;
}
.link-list a {
	text-decoration: none;
	color: rgba(0, 0, 0, .5);
	transition: color .3s ease;
}
.link-list a:hover {
	color: rgba(0, 0, 0, .3);
}
.social-wrapper {
	margin-top: 100px;
	text-align: center;
	padding: 0 auto;
}
.social-wrapper a {
	margin: 4px;
	font-size: 24px;
	color: rgba(0, 0, 0, .5);
	transition: color .3s ease;
}
.social-wrapper a:hover {
	color: rgba(0, 0, 0, .3);
}
.social-open {
	opacity: 1;
	transition: opacity .7s ease-out;
	transition-delay: .3s;
}
.social-closed {
	opacity: 0;
	transition: opacity .3s ease-out;
}
const Menu = React.createClass({
    displayName: "Menu",
    getInitialState: function () {
        return { open: false };
    },
    toggleMenu: function () {
        this.setState({ open: !this.state.open });
    },
    render: function () {
        const linksArray = [
            { name: "home", url: "#" },
            { name: "log in", url: "#" },
            { name: "photos", url: "#" },
            { name: "contact", url: "#" },
            { name: "download", url: "#" }];
        const socialArray = [
            {
                icon: "fa fa-github-square",
                url: "http://frontendfreecode.com/"
            },
            {
                icon: "fa fa-instagram",
                url: "http://frontendfreecode.com/"
            },
            {
                icon: "fa fa-tumblr-square",
                url: "http://frontendfreecode.com/"
            }];
        return /*#__PURE__*/(
            React.createElement("div", null, /*#__PURE__*/
                React.createElement(Panel, {
                    open: this.state.open,
                    links: linksArray,
                    socialLinks: socialArray
                }), /*#__PURE__*/
                React.createElement(Button, {
                    toggle: this.toggleMenu,
                    open: this.state.open
                })));
    }
});
const Button = React.createClass({
    displayName: "Button",
    render: function () {
        return /*#__PURE__*/(
            React.createElement("button", {
                className: this.props.open ?
                    "menu-toggle close-button" :
                    "menu-toggle ",
                onClick: this.props.toggle
            }, " ", /*#__PURE__*/
                React.createElement("i", { className: "fa fa-plus" })));
    }
});
const Panel = React.createClass({
    displayName: "Panel",
    render: function () {
        return /*#__PURE__*/(
            React.createElement("div", {
                className: this.props.open ?
                    "menu-wrapper menu-open" :
                    "menu-wrapper"
            }, /*#__PURE__*/
                React.createElement(Links, {
                    links: this.props.links,
                    open: this.props.open
                }), /*#__PURE__*/
                React.createElement(Social, {
                    socialLinks: this.props.socialLinks,
                    open: this.props.open
                })));
    }
});
const Links = React.createClass({
    displayName: "Links",
    render: function () {
        const linkList = this.props.links.map((link) => /*#__PURE__*/
            React.createElement("li", { className: "link" }, /*#__PURE__*/
                React.createElement("a", { href: link.url }, link.name)));
        return /*#__PURE__*/(
            React.createElement("div", {
                className: this.props.open ?
                    "links-wrapper" :
                    "links-wrapper links-wrapper-closed"
            }, " ", /*#__PURE__*/
                React.createElement("ul", { className: "link-list" },
                    linkList)));
    }
});
const Social = React.createClass({
    displayName: "Social",
    render: function () {
        const socialLinks = this.props.socialLinks.map((link) => /*#__PURE__*/
            React.createElement("a", { href: link.url }, /*#__PURE__*/
                React.createElement("i", { className: link.icon })));
        return /*#__PURE__*/(
            React.createElement("div", {
                className: this.props.open ?
                    "social-wrapper social-open" :
                    "social-wrapper social-closed"
            }, " ",
                socialLinks));
    }
});
ReactDOM.render( /*#__PURE__*/
    React.createElement(Menu, null),
    document.getElementById('menu'));
<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css'>
<script src='https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.24/browser.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/15.6.1/react.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/15.6.1/react-dom.min.js'></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- This script got from frontendfreecode.com -->

<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css'>
<script src='https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.24/browser.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/15.6.1/react.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/15.6.1/react-dom.min.js'></script>
<style>
body {
	background: rgba(241, 206, 184, 1);
	background: -webkit-linear-gradient( -45deg, rgba(241, 206, 184, 1) 0%, rgba(142, 186, 163, 1) 100%);
	font-family: "helvetica neue", helvetica;
	font-weight: light;
	height: 100%;
	margin: 0;
	background-repeat: no-repeat;
	background-attachment: fixed;
}
.menu-wrapper {
	height: 600px;
	width: 250px;
	background-color: rgba(255, 255, 255, .8);
	margin-left: -450px;
	margin-top: -10px;
	opacity: 0;
	-webkit-box-shadow: 10px 10px 6px -8px rgba(161, 136, 119, .7);
	transition: all .3s ease-in-out;
	border-radius: 2px;
	padding: 0 auto;
	border-right: 1px solid rgba(0, 0, 0, .2);
	border-bottom: 1px solid rgba(0, 0, 0, .2);
}
.menu-open {
	margin-left: 0px;
	opacity: 1;
}
.menu-toggle {
	cursor: pointer;
	position: absolute;
	z-index: 1000;
	top: 0;
	margin: 20px;
	padding: 0px;
	height: 50px;
	width: 50px;
	font-size: 20px;
	color: rgba(0, 0, 0, .5);
	font-weight: bold;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, .8);
	transform: rotate(0deg);
	transition: all .2s ease-in;
	border: 0 none;
}
.menu-toggle:hover {
	cursor: pointer;
	transform: scale(1.1) rotate(0deg);
	-webkit-box-shadow: 10px 2px 8px -8px rgba(179, 164, 139, .6);
}
.menu-toggle:focus {
	cursor: pointer;
	outline: 0 none;
}
.close-button {
	cursor: pointer;
	transform: rotate(45deg);
	background-color: rgba(109, 163, 140, 1);
	-webkit-box-shadow: 10px 2px 8px -8px rgba(179, 164, 139, .6);
}
.close-button:hover {
	transform: scale(1.1) rotate(45deg);
}
.links-wrapper {
	margin: 10px;
	padding: 10px;
	text-align: right;
	opacity: 1;
	transition: all .7s ease-out;
	transition-delay: .3s;
	letter-spacing: 2px;
}
.links-wrapper-closed {
	padding-top: 50px;
	opacity: 0;
	letter-spacing: 0px;
}
.link-list {
	padding-top: 90px;
	padding-right: 25px;
	padding-left: 25px;
}
.link-list li {
	list-style-type: none;
	text-transform: uppercase;
	margin: 0;
	margin-bottom: 30px;
	border-bottom: 2px solid rgba(0, 0, 0, .5);
	padding: 3px;
}
.link-list a {
	text-decoration: none;
	color: rgba(0, 0, 0, .5);
	transition: color .3s ease;
}
.link-list a:hover {
	color: rgba(0, 0, 0, .3);
}
.social-wrapper {
	margin-top: 100px;
	text-align: center;
	padding: 0 auto;
}
.social-wrapper a {
	margin: 4px;
	font-size: 24px;
	color: rgba(0, 0, 0, .5);
	transition: color .3s ease;
}
.social-wrapper a:hover {
	color: rgba(0, 0, 0, .3);
}
.social-open {
	opacity: 1;
	transition: opacity .7s ease-out;
	transition-delay: .3s;
}
.social-closed {
	opacity: 0;
	transition: opacity .3s ease-out;
}
</style>

</head>
<body>
<div id="menu">
</div><div id="bcl"><a style="font-size:8pt;text-decoration:none;" href="http://www.devanswer.com">Free Frontend</a></div>
<script>
const Menu = React.createClass({
    displayName: "Menu",
    getInitialState: function () {
        return { open: false };
    },
    toggleMenu: function () {
        this.setState({ open: !this.state.open });
    },
    render: function () {
        const linksArray = [
            { name: "home", url: "#" },
            { name: "log in", url: "#" },
            { name: "photos", url: "#" },
            { name: "contact", url: "#" },
            { name: "download", url: "#" }];
        const socialArray = [
            {
                icon: "fa fa-github-square",
                url: "http://frontendfreecode.com/"
            },
            {
                icon: "fa fa-instagram",
                url: "http://frontendfreecode.com/"
            },
            {
                icon: "fa fa-tumblr-square",
                url: "http://frontendfreecode.com/"
            }];
        return /*#__PURE__*/(
            React.createElement("div", null, /*#__PURE__*/
                React.createElement(Panel, {
                    open: this.state.open,
                    links: linksArray,
                    socialLinks: socialArray
                }), /*#__PURE__*/
                React.createElement(Button, {
                    toggle: this.toggleMenu,
                    open: this.state.open
                })));
    }
});
const Button = React.createClass({
    displayName: "Button",
    render: function () {
        return /*#__PURE__*/(
            React.createElement("button", {
                className: this.props.open ?
                    "menu-toggle close-button" :
                    "menu-toggle ",
                onClick: this.props.toggle
            }, " ", /*#__PURE__*/
                React.createElement("i", { className: "fa fa-plus" })));
    }
});
const Panel = React.createClass({
    displayName: "Panel",
    render: function () {
        return /*#__PURE__*/(
            React.createElement("div", {
                className: this.props.open ?
                    "menu-wrapper menu-open" :
                    "menu-wrapper"
            }, /*#__PURE__*/
                React.createElement(Links, {
                    links: this.props.links,
                    open: this.props.open
                }), /*#__PURE__*/
                React.createElement(Social, {
                    socialLinks: this.props.socialLinks,
                    open: this.props.open
                })));
    }
});
const Links = React.createClass({
    displayName: "Links",
    render: function () {
        const linkList = this.props.links.map((link) => /*#__PURE__*/
            React.createElement("li", { className: "link" }, /*#__PURE__*/
                React.createElement("a", { href: link.url }, link.name)));
        return /*#__PURE__*/(
            React.createElement("div", {
                className: this.props.open ?
                    "links-wrapper" :
                    "links-wrapper links-wrapper-closed"
            }, " ", /*#__PURE__*/
                React.createElement("ul", { className: "link-list" },
                    linkList)));
    }
});
const Social = React.createClass({
    displayName: "Social",
    render: function () {
        const socialLinks = this.props.socialLinks.map((link) => /*#__PURE__*/
            React.createElement("a", { href: link.url }, /*#__PURE__*/
                React.createElement("i", { className: link.icon })));
        return /*#__PURE__*/(
            React.createElement("div", {
                className: this.props.open ?
                    "social-wrapper social-open" :
                    "social-wrapper social-closed"
            }, " ",
                socialLinks));
    }
});
ReactDOM.render( /*#__PURE__*/
    React.createElement(Menu, null),
    document.getElementById('menu'));
</script>

</body>
</html>
Preview