content logo

React Headers:

React Horizontal Selection Menu

If you don't like vertical designs for your websites, you are able to use a horizontal theme. The following post presents the React Horizontal Selection Menu with a fantastic design. With the help of this amazing React Selection Menu, you are able to put together the contents of your website beautifully. As the Free Horizontal Menu Code has a smooth effect and beautiful design, users feel better while utilizing it. As a result, it can have an incredible impact on gaining more viewers. So, this post is not only helpful in attracting new audiences, but it's also so helpful for classifying the content of your website.

A preview of this HTML Selection Menu is provided below that shows the performance of this code. By looking at this preview, you can realize that the mentioned code has a white background with four categories. These categories have a gray background and black text. When you put the mouse's cursor on each item, its background will change to light blue. After selecting your considered part, its background changes to a darker blue, and other text turns white. When you choose an item of this Simple React Menu Code, your selected part will be read down in a smaller font size.

#

React Selection Menu

#

Free Horizontal Menu Code

#

HTML Selection Menu

#

Simple React Menu Code

<!-- This script got from frontendfreecode.com -->
<div id="container">   
</div><a style="font-size: 8pt; text-decoration: none" target="_blank" href="http://frontendfreecode.com">Free Frontend</a>
                                                                            
* {
	padding: 0;
	margin: 0;
}
html {
	font: 14px normal Arial, sans-serif;
	color: #626771;
	background-color: #fff;
}
body {
	padding: 60px;
	text-align: center;
}
ul {
	list-style: none;
	display: inline-block;
}
ul li {
	display: inline-block;
	padding: 10px 20px;
	cursor: pointer;
	background-color: #eee;
	color: #7B8585;
	transition: 0.3s;
}
ul li:hover {
	background-color: #beecea;
}
ul li.focused {
	color: #fff;
	background-color: #41c7c2;
}
p {
	padding-top: 15px;
	font-size: 12px;
}
var MenuExample = React.createClass({
    displayName: "MenuExample",
    getInitialState: function () {
        return { focused: 0 };
    },
    clicked: function (index) {
        this.setState({ focused: index });
    },
    render: function () {
        var self = this;
        return /*#__PURE__*/(
            React.createElement("div", null, /*#__PURE__*/
                React.createElement("ul", null, this.props.items.map(function (m, index) {
                    var style = '';
                    if (self.state.focused == index) {
                        style = 'focused';
                    }
                    return /*#__PURE__*/React.createElement("li", { className: style, onClick: self.clicked.bind(self, index) }, m);
                })),
                React.createElement("p", null, "Selected: ", this.props.items[this.state.focused])));
    }
});
ReactDOM.render( /*#__PURE__*/
    React.createElement(MenuExample, { items: ['Home', 'Services', 'About', 'Contact us'] }),
    document.getElementById('container'));
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react-dom.min.js'></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- This script got from frontendfreecode.com -->

<script src='https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react-dom.min.js'></script>
<style>
* {
	padding: 0;
	margin: 0;
}
html {
	font: 14px normal Arial, sans-serif;
	color: #626771;
	background-color: #fff;
}
body {
	padding: 60px;
	text-align: center;
}
ul {
	list-style: none;
	display: inline-block;
}
ul li {
	display: inline-block;
	padding: 10px 20px;
	cursor: pointer;
	background-color: #eee;
	color: #7B8585;
	transition: 0.3s;
}
ul li:hover {
	background-color: #beecea;
}
ul li.focused {
	color: #fff;
	background-color: #41c7c2;
}
p {
	padding-top: 15px;
	font-size: 12px;
}
</style>

</head>
<body>
<div id="container">   
</div><div id="bcl"><a style="font-size:8pt;text-decoration:none;" href="http://www.devanswer.com">Free Frontend</a></div>
<script>
var MenuExample = React.createClass({
    displayName: "MenuExample",
    getInitialState: function () {
        return { focused: 0 };
    },
    clicked: function (index) {
        this.setState({ focused: index });
    },
    render: function () {
        var self = this;
        return /*#__PURE__*/(
            React.createElement("div", null, /*#__PURE__*/
                React.createElement("ul", null, this.props.items.map(function (m, index) {
                    var style = '';
                    if (self.state.focused == index) {
                        style = 'focused';
                    }
                    return /*#__PURE__*/React.createElement("li", { className: style, onClick: self.clicked.bind(self, index) }, m);
                })),
                React.createElement("p", null, "Selected: ", this.props.items[this.state.focused])));
    }
});
ReactDOM.render( /*#__PURE__*/
    React.createElement(MenuExample, { items: ['Home', 'Services', 'About', 'Contact us'] }),
    document.getElementById('container'));
</script>

</body>
</html>
Preview