content logo

React Menus:

React Sliding Menu with Hover Effect

If you have a website and like to change its design, look at this post and use it on your page. This is the React Sliding Menu with Hover Effect in this post. With the help of this beautiful HTML Menu with Icon, you are able to add much information in a small place. As a result, this Simple React Menu allows you to save the physical space of your website. Additionally, your viewers can access their considered information on your website more easily. So, if you want to increase the beauty of your website, this Free React Menu Code is so useful.

This Javascript Menu Example preview is presented below to show this code's performance. As you see, this post has a light background, the upside is blue, and the bottom side is white. So, it is fantastic code in colorful websites. There is a blue button in the middle of this code in a circle. When choosing this icon, you will face a menu with hover effects. In this Menu Hover Effect, you can see different items with their icons. When you put the mouse’s cursor on each item, a line will be displayed under that part.

#

HTML Menu with Icon

#

Simple React Menu

#

Free React Menu Code

#

Javascript Menu Example

#

Menu Hover Effect

<!-- This script got from frontendfreecode.com -->
<div id="root"></div><a style="font-size: 8pt; text-decoration: none" target="_blank" href="http://frontendfreecode.com">Free Frontend</a>
                                                                            
#root {
	background: linear-gradient(to bottom, #a2ded0, #ffffff);
	padding-bottom: 2.5rem;
	font-family: "Microsoft YaHei UI Light", "PingFangSC-Light", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}
#root {
	background: linear-gradient(to bottom, #a2ded0, #ffffff);
	padding-bottom: 2.5rem;
}
pre {
	background: FloralWhite;
	padding: 1rem;
	box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
}
pre {
	overflow-x: auto;
	white-space: pre-wrap;
	white-space: -moz-pre-wrap;
	white-space: -pre-wrap;
	white-space: -o-pre-wrap;
	word-wrap: break-word;
}
.shadow-inset, .shadow-inset:focus, textarea {
	box-shadow: inset .25rem .25rem .5rem rgba(0, 0, 0, .5);
}
.callout {
	padding: 1.25rem;
	margin-bottom: 1.25rem;
	border: 1px solid #eee;
	border-left-width: .25rem;
	border-radius: .25rem;
	background-color: white;
}
.callout p:last-child {
	margin-bottom: 0;
}
.callout-primary {
	border-left-color: #007bff;
}
.callout-secondary {
	border-left-color: #6c757d;
}
.callout-info {
	border-left-color: #5bc0de;
}
.callout-success {
	border-left-color: #28a745;
}
.callout-warning {
	/*border-left-color: #ffc107;*/
	border-left-color: #f0ad4e;
}
.callout-danger {
	/*border-left-color: #dc3545;*/
	border-left-color: #d9534f;
}
.callout-light {
	border-left-color: #f8f9fa;
}
.callout-dark {
	border-left-color: #343a40;
}
.btn-prev:before {
	content: "\276e";
	margin-right: .5rem;
}
.btn-next:after {
	content: "\276f";
	margin-left: .5rem;
	float: right;
}
.menu {
	--front: #275EFE;
	--back: #D93757;
	--icon: white;
	-webkit-perspective: 600px;
	perspective: 600px;
	width: 48px;
	height: 48px;
	position: relative;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.menu input {
	display: none;
}
.menu input+div span {
	--rotateY: 0deg;
	--background: var(--front);
	-webkit-transform: rotateY(var(--rotateY));
	transform: rotateY(var(--rotateY));
	-webkit-transform-style: preserve-3d;
	transform-style: preserve-3d;
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background: var(--background);
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
	transition: -webkit-transform 0.6s cubic-bezier(0.2, 0.64, 0.48, 1.24);
	transition: transform 0.6s cubic-bezier(0.2, 0.64, 0.48, 1.24);
	transition: transform 0.6s cubic-bezier(0.2, 0.64, 0.48, 1.24), -webkit-transform 0.6s cubic-bezier(0.2, 0.64, 0.48, 1.24);
}
.menu input+div span:before, .menu input+div span:after {
	--rotate: 0deg;
	content: '';
	position: absolute;
	width: 16px;
	height: 2px;
	border-radius: 1px;
	top: 50%;
	left: 50%;
	background: var(--icon);
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
	-webkit-transform: translate(-50%, -50%) rotate(var(--rotate)) translateZ(6px);
	transform: translate(-50%, -50%) rotate(var(--rotate)) translateZ(6px);
}
.menu input+div span:first-child {
	--background: var(--back);
}
.menu input+div span:first-child:before {
	--rotate: -45deg;
}
.menu input+div span:first-child:after {
	--rotate: 45deg;
}
.menu input+div span:last-child {
	--rotateY: 180deg;
}
.menu input+div span:last-child:before {
	box-shadow: 0 -5px 0 var(--icon), 0 5px 0 var(--icon);
}
.menu input:checked+div span:first-child {
	--rotateY: -180deg;
}
.menu input:checked+div span:last-child {
	--rotateY: 0deg;
}
console.clear();
function Hamburger(props) {
    const { children } = props;
    const [toggle, setToggle] = React.useState(true);
    const [effect, setEffect] = React.useState('');
    const handleClick = e => {
        setToggle(!toggle);
    };
    React.useEffect(() => {
        if (toggle) {
            setEffect('slideOutLeft fadeOut');
        } else {
            setEffect('slideInLeft fadeIn');
        }
    }, [toggle]);
    return /*#__PURE__*/(
        React.createElement("div", null, /*#__PURE__*/
            React.createElement("label", { className: "menu" }, /*#__PURE__*/
                React.createElement("input", { type: "checkbox", checked: toggle, onClick: handleClick }), /*#__PURE__*/
                React.createElement("div", null, /*#__PURE__*/
                    React.createElement("span", null), /*#__PURE__*/
                    React.createElement("span", null))), /*#__PURE__*/
            React.createElement("div", { className: `animated faster ${effect}` }, children)));
}
const list = [
    { icon: '\u{1f4dd}', name: 'My Blog', url: 'http://frontendfreecode.com/' },
    { icon: '\u{1f4dc}', name: 'My Portfolio', url: 'http://frontendfreecode.com/' },
    { icon: '\u{1f4bb}', name: 'My Dev Tools', url: 'http://frontendfreecode.com/' }];
function App(props) {
    return /*#__PURE__*/(
        
            React.createElement("div", { className: "text-center" }, /*#__PURE__*/
                React.createElement(Hamburger, null, /*#__PURE__*/
                    React.createElement("div", { className: "list-group" },
                        list.map((e, i) => {
                            const { icon, name, url } = e;
                            return /*#__PURE__*/(
                                React.createElement(A, { key: i, href: url, blank: true, className: "list-group-item list-group-item-action shadow h3 btn-next" }, /*#__PURE__*/React.createElement("span", { className: "mr-3" }, icon), name));
                        })))));
}
function trace(value, size) {
    if (typeof size === 'number' && size > 0) {
        console.log(JSON.stringify(value, null, size));
    } else {
        console.log(value);
    }
}
function todate() {
    return new Date().toISOString().split('T')[0];
}
function lipsum(n = 10, dot = false) {
    if (typeof n !== 'number' || typeof n === 'number' && n < 1) n = 10;
    const words = ['lorem', 'ipsum', 'dolor', 'sit', 'amet', 'consectetur', 'adipiscing', 'elit', 'vivamus', 'et', 'accumsan', 'augue', 'duis', 'eget', 'nunc', 'id', 'sodales', 'finibus', 'vestibulum', 'sagittis', 'magna', 'nec', 'rutrum', 'volutpat', 'risus', 'tincidunt', 'justo', 'non', 'gravida', 'tortor', 'enim', 'in', 'urna', 'ut', 'vel', 'metus', 'pellentesque', 'porttitor', 'vitae', 'nisi', 'nullam', 'faucibus', 'condimentum', 'quam', 'imperdiet', 'class', 'aptent', 'taciti', 'sociosqu', 'ad', 'litora', 'torquent', 'per', 'conubia', 'nostra', 'inceptos', 'himenaeos', 'interdum', 'malesuada', 'fames', 'ac', 'ante', 'primis', 'curabitur', 'nibh', 'quis', 'iaculis', 'cras', 'mollis', 'eu', 'congue', 'leo'];
    const count = Math.floor(Math.random() * n + 1);
    const sentence = [];
    const indexes = new Array(count).fill(0).map(index => Math.floor(Math.random() * words.length));
    indexes.forEach((index, i) => {
        const word = words[index];
        if (i === 0)
            sentence.push(word.charAt(0).toUpperCase() + word.substr(1)); else
            sentence.push(word);
    });
    if (dot) return sentence.join(' ').concat('.');
    return sentence.join(' ');
}
function PreCode(props) {
    const { children, value, size = 2 } = props;
    if (typeof value === 'string') {
        return /*#__PURE__*/(
            React.createElement("div", null, /*#__PURE__*/React.createElement("pre", null, /*#__PURE__*/React.createElement("code", null, value.trim()))));
    }
    if (typeof value === 'object' || typeof value === 'number' || typeof value === 'boolean') {
        return /*#__PURE__*/(
            React.createElement("div", null, /*#__PURE__*/React.createElement("pre", null, /*#__PURE__*/React.createElement("code", null, JSON.stringify(value, null, size)))));
    }
    if (typeof children === 'string') {
        return /*#__PURE__*/(
            React.createElement("div", null, /*#__PURE__*/React.createElement("pre", null, /*#__PURE__*/React.createElement("code", null, children.trim()))));
    }
    return /*#__PURE__*/(
        React.createElement("div", null, /*#__PURE__*/React.createElement("pre", null, /*#__PURE__*/React.createElement("code", null, JSON.stringify(children, null, size)))));
}
function Button(props) {
    const { children, className = '', outline = false, sm = false, lg = false, block = false, disabled = false, shadow = false, label = '', title = '', button = true, submit = false, reset = false, onClick } = props;
    const classNames = ['btn', className];
    Object.keys(props).forEach(e => {
        if (['primary', 'secondary', 'info', 'success', 'warning', 'danger', 'light', 'dark', 'link'].indexOf(e) >= 0) {
            classNames.push(`btn-${outline ? 'outline-' : ''}${e}`);
        }
        if (['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].indexOf(e) >= 0) classNames.push(e);
    });
    if (sm) classNames.push('btn-sm');
    if (lg) classNames.push('btn-lg');
    if (block) classNames.push('btn-block');
    if (shadow) classNames.push('shadow');
    let type = 'button';
    if (submit) type = 'submit'; else
        if (reset) type = 'reset';
    return /*#__PURE__*/(
        React.createElement("button", { className: classNames.join(' '), onClick: onClick, disabled: disabled, type: type, title: title }, label || children));
}
function Badge(props) {
    const { children, className = '', pill, title = '', shadow = false } = props;
    const classNames = ['badge', className];
    if (pill) {
        classNames.push('badge-pill');
    }
    Object.keys(props).forEach(e => {
        if (['primary', 'secondary', 'info', 'success', 'warning', 'danger', 'light', 'dark'].indexOf(e) >= 0) {
            classNames.push(`badge-${e}`);
        }
        if (['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].indexOf(e) >= 0) {
            classNames.push(e);
        }
    });
    if (shadow) classNames.push('shadow');
    return /*#__PURE__*/(
        React.createElement("span", { className: classNames.join(' '), title: title }, children));
}
function A(props) {
    const { href = '', label = '', className = '', children, color, target = '', title = '', shadow = false, outline = false, sm = false, lg = false, blank = false } = props;
    const id = `link${Date.now()}${new Array(6).fill(0).map(e => Math.floor(Math.random() * 10)).join('')}`;
    const classNames = [id, className];
    const style = {};
    if (typeof color === 'string' && color.length > 0) style.color = color;
    if (shadow) classNames.push('shadow');
    let isBtn = false;
    Object.keys(props).forEach(e => {
        if (['primary', 'secondary', 'info', 'success', 'warning', 'danger', 'light', 'dark'].indexOf(e) >= 0) {
            if (outline) classNames.push(`btn btn-outline-${e}`); else
                classNames.push(`btn btn-${e}`);
            isBtn = true;
        }
        if (['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].indexOf(e) >= 0) classNames.push(e);
    });
    if (isBtn) {
        if (sm) classNames.push('btn-sm');
        if (lg) classNames.push('btn-lg');
    }
    return /*#__PURE__*/(
        React.createElement(React.Fragment, null, /*#__PURE__*/
            React.createElement("style", null, `#${id}{position:relative;text-decoration:none;}#${id}:hover{text-decoration:none;}#${id}:before{content:"";position:absolute;width:100%;height:.2rem;bottom:0;left:0;background-color:currentColor;visibility:hidden;transform:scaleX(0);transition:all 0.3s ease-in-out 0s;-webkit-transform:scaleX(0);-webkit-transition:all 0.3s ease-in-out 0s;}#${id}:hover:before{visibility:visible;-webkit-transform:scaleX(1);transform:scaleX(1);}`), /*#__PURE__*/
            React.createElement("a", { id: id, href: href, className: classNames.join(' '), style: style, target: target || blank ? '_blank' : '', title: title || !target && blank ? 'Open in New Tab' : '' }, label || children)));
}
function Callout(props) {
    const { title = '', children, className = '', shadow = false } = props;
    const classNames = ['callout'];
    Object.keys(props).forEach(e => {
        if (['primary', 'secondary', 'info', 'success', 'warning', 'danger', 'light', 'dark'].indexOf(e) >= 0) {
            classNames.push(`callout-${e}`);
        }
    });
    if (shadow) {
        classNames.push('shadow');
    }
    return /*#__PURE__*/(
        React.createElement("div", { className: classNames.join(' ') },
            typeof title === 'string' && title.length > 0 && /*#__PURE__*/
            React.createElement("h5", null, title), /*#__PURE__*/
            React.createElement("p", null, children)));
}
ReactDOM.render( /*#__PURE__*/
    React.createElement(App, null),
    document.getElementById('root'));
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.min.css'>
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css'>
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/16.8.6/umd/react.production.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.8.6/umd/react-dom.production.min.js'></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- This script got from frontendfreecode.com -->

<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.min.css'>
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css'>
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/16.8.6/umd/react.production.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.8.6/umd/react-dom.production.min.js'></script>
<style>
#root {
	background: linear-gradient(to bottom, #a2ded0, #ffffff);
	padding-bottom: 2.5rem;
	font-family: "Microsoft YaHei UI Light", "PingFangSC-Light", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}
#root {
	background: linear-gradient(to bottom, #a2ded0, #ffffff);
	padding-bottom: 2.5rem;
}
pre {
	background: FloralWhite;
	padding: 1rem;
	box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
}
pre {
	overflow-x: auto;
	white-space: pre-wrap;
	white-space: -moz-pre-wrap;
	white-space: -pre-wrap;
	white-space: -o-pre-wrap;
	word-wrap: break-word;
}
.shadow-inset, .shadow-inset:focus, textarea {
	box-shadow: inset .25rem .25rem .5rem rgba(0, 0, 0, .5);
}
.callout {
	padding: 1.25rem;
	margin-bottom: 1.25rem;
	border: 1px solid #eee;
	border-left-width: .25rem;
	border-radius: .25rem;
	background-color: white;
}
.callout p:last-child {
	margin-bottom: 0;
}
.callout-primary {
	border-left-color: #007bff;
}
.callout-secondary {
	border-left-color: #6c757d;
}
.callout-info {
	border-left-color: #5bc0de;
}
.callout-success {
	border-left-color: #28a745;
}
.callout-warning {
	/*border-left-color: #ffc107;*/
	border-left-color: #f0ad4e;
}
.callout-danger {
	/*border-left-color: #dc3545;*/
	border-left-color: #d9534f;
}
.callout-light {
	border-left-color: #f8f9fa;
}
.callout-dark {
	border-left-color: #343a40;
}
.btn-prev:before {
	content: "\276e";
	margin-right: .5rem;
}
.btn-next:after {
	content: "\276f";
	margin-left: .5rem;
	float: right;
}
.menu {
	--front: #275EFE;
	--back: #D93757;
	--icon: white;
	-webkit-perspective: 600px;
	perspective: 600px;
	width: 48px;
	height: 48px;
	position: relative;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.menu input {
	display: none;
}
.menu input+div span {
	--rotateY: 0deg;
	--background: var(--front);
	-webkit-transform: rotateY(var(--rotateY));
	transform: rotateY(var(--rotateY));
	-webkit-transform-style: preserve-3d;
	transform-style: preserve-3d;
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background: var(--background);
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
	transition: -webkit-transform 0.6s cubic-bezier(0.2, 0.64, 0.48, 1.24);
	transition: transform 0.6s cubic-bezier(0.2, 0.64, 0.48, 1.24);
	transition: transform 0.6s cubic-bezier(0.2, 0.64, 0.48, 1.24), -webkit-transform 0.6s cubic-bezier(0.2, 0.64, 0.48, 1.24);
}
.menu input+div span:before, .menu input+div span:after {
	--rotate: 0deg;
	content: '';
	position: absolute;
	width: 16px;
	height: 2px;
	border-radius: 1px;
	top: 50%;
	left: 50%;
	background: var(--icon);
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
	-webkit-transform: translate(-50%, -50%) rotate(var(--rotate)) translateZ(6px);
	transform: translate(-50%, -50%) rotate(var(--rotate)) translateZ(6px);
}
.menu input+div span:first-child {
	--background: var(--back);
}
.menu input+div span:first-child:before {
	--rotate: -45deg;
}
.menu input+div span:first-child:after {
	--rotate: 45deg;
}
.menu input+div span:last-child {
	--rotateY: 180deg;
}
.menu input+div span:last-child:before {
	box-shadow: 0 -5px 0 var(--icon), 0 5px 0 var(--icon);
}
.menu input:checked+div span:first-child {
	--rotateY: -180deg;
}
.menu input:checked+div span:last-child {
	--rotateY: 0deg;
}
</style>

</head>
<body>
<div id="root"></div><div id="bcl"><a style="font-size:8pt;text-decoration:none;" href="http://www.devanswer.com">Free Frontend</a></div>
<script>
console.clear();
function Hamburger(props) {
    const { children } = props;
    const [toggle, setToggle] = React.useState(true);
    const [effect, setEffect] = React.useState('');
    const handleClick = e => {
        setToggle(!toggle);
    };
    React.useEffect(() => {
        if (toggle) {
            setEffect('slideOutLeft fadeOut');
        } else {
            setEffect('slideInLeft fadeIn');
        }
    }, [toggle]);
    return /*#__PURE__*/(
        React.createElement("div", null, /*#__PURE__*/
            React.createElement("label", { className: "menu" }, /*#__PURE__*/
                React.createElement("input", { type: "checkbox", checked: toggle, onClick: handleClick }), /*#__PURE__*/
                React.createElement("div", null, /*#__PURE__*/
                    React.createElement("span", null), /*#__PURE__*/
                    React.createElement("span", null))), /*#__PURE__*/
            React.createElement("div", { className: `animated faster ${effect}` }, children)));
}
const list = [
    { icon: '\u{1f4dd}', name: 'My Blog', url: 'http://frontendfreecode.com/' },
    { icon: '\u{1f4dc}', name: 'My Portfolio', url: 'http://frontendfreecode.com/' },
    { icon: '\u{1f4bb}', name: 'My Dev Tools', url: 'http://frontendfreecode.com/' }];
function App(props) {
    return /*#__PURE__*/(
        
            React.createElement("div", { className: "text-center" }, /*#__PURE__*/
                React.createElement(Hamburger, null, /*#__PURE__*/
                    React.createElement("div", { className: "list-group" },
                        list.map((e, i) => {
                            const { icon, name, url } = e;
                            return /*#__PURE__*/(
                                React.createElement(A, { key: i, href: url, blank: true, className: "list-group-item list-group-item-action shadow h3 btn-next" }, /*#__PURE__*/React.createElement("span", { className: "mr-3" }, icon), name));
                        })))));
}
function trace(value, size) {
    if (typeof size === 'number' && size > 0) {
        console.log(JSON.stringify(value, null, size));
    } else {
        console.log(value);
    }
}
function todate() {
    return new Date().toISOString().split('T')[0];
}
function lipsum(n = 10, dot = false) {
    if (typeof n !== 'number' || typeof n === 'number' && n < 1) n = 10;
    const words = ['lorem', 'ipsum', 'dolor', 'sit', 'amet', 'consectetur', 'adipiscing', 'elit', 'vivamus', 'et', 'accumsan', 'augue', 'duis', 'eget', 'nunc', 'id', 'sodales', 'finibus', 'vestibulum', 'sagittis', 'magna', 'nec', 'rutrum', 'volutpat', 'risus', 'tincidunt', 'justo', 'non', 'gravida', 'tortor', 'enim', 'in', 'urna', 'ut', 'vel', 'metus', 'pellentesque', 'porttitor', 'vitae', 'nisi', 'nullam', 'faucibus', 'condimentum', 'quam', 'imperdiet', 'class', 'aptent', 'taciti', 'sociosqu', 'ad', 'litora', 'torquent', 'per', 'conubia', 'nostra', 'inceptos', 'himenaeos', 'interdum', 'malesuada', 'fames', 'ac', 'ante', 'primis', 'curabitur', 'nibh', 'quis', 'iaculis', 'cras', 'mollis', 'eu', 'congue', 'leo'];
    const count = Math.floor(Math.random() * n + 1);
    const sentence = [];
    const indexes = new Array(count).fill(0).map(index => Math.floor(Math.random() * words.length));
    indexes.forEach((index, i) => {
        const word = words[index];
        if (i === 0)
            sentence.push(word.charAt(0).toUpperCase() + word.substr(1)); else
            sentence.push(word);
    });
    if (dot) return sentence.join(' ').concat('.');
    return sentence.join(' ');
}
function PreCode(props) {
    const { children, value, size = 2 } = props;
    if (typeof value === 'string') {
        return /*#__PURE__*/(
            React.createElement("div", null, /*#__PURE__*/React.createElement("pre", null, /*#__PURE__*/React.createElement("code", null, value.trim()))));
    }
    if (typeof value === 'object' || typeof value === 'number' || typeof value === 'boolean') {
        return /*#__PURE__*/(
            React.createElement("div", null, /*#__PURE__*/React.createElement("pre", null, /*#__PURE__*/React.createElement("code", null, JSON.stringify(value, null, size)))));
    }
    if (typeof children === 'string') {
        return /*#__PURE__*/(
            React.createElement("div", null, /*#__PURE__*/React.createElement("pre", null, /*#__PURE__*/React.createElement("code", null, children.trim()))));
    }
    return /*#__PURE__*/(
        React.createElement("div", null, /*#__PURE__*/React.createElement("pre", null, /*#__PURE__*/React.createElement("code", null, JSON.stringify(children, null, size)))));
}
function Button(props) {
    const { children, className = '', outline = false, sm = false, lg = false, block = false, disabled = false, shadow = false, label = '', title = '', button = true, submit = false, reset = false, onClick } = props;
    const classNames = ['btn', className];
    Object.keys(props).forEach(e => {
        if (['primary', 'secondary', 'info', 'success', 'warning', 'danger', 'light', 'dark', 'link'].indexOf(e) >= 0) {
            classNames.push(`btn-${outline ? 'outline-' : ''}${e}`);
        }
        if (['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].indexOf(e) >= 0) classNames.push(e);
    });
    if (sm) classNames.push('btn-sm');
    if (lg) classNames.push('btn-lg');
    if (block) classNames.push('btn-block');
    if (shadow) classNames.push('shadow');
    let type = 'button';
    if (submit) type = 'submit'; else
        if (reset) type = 'reset';
    return /*#__PURE__*/(
        React.createElement("button", { className: classNames.join(' '), onClick: onClick, disabled: disabled, type: type, title: title }, label || children));
}
function Badge(props) {
    const { children, className = '', pill, title = '', shadow = false } = props;
    const classNames = ['badge', className];
    if (pill) {
        classNames.push('badge-pill');
    }
    Object.keys(props).forEach(e => {
        if (['primary', 'secondary', 'info', 'success', 'warning', 'danger', 'light', 'dark'].indexOf(e) >= 0) {
            classNames.push(`badge-${e}`);
        }
        if (['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].indexOf(e) >= 0) {
            classNames.push(e);
        }
    });
    if (shadow) classNames.push('shadow');
    return /*#__PURE__*/(
        React.createElement("span", { className: classNames.join(' '), title: title }, children));
}
function A(props) {
    const { href = '', label = '', className = '', children, color, target = '', title = '', shadow = false, outline = false, sm = false, lg = false, blank = false } = props;
    const id = `link${Date.now()}${new Array(6).fill(0).map(e => Math.floor(Math.random() * 10)).join('')}`;
    const classNames = [id, className];
    const style = {};
    if (typeof color === 'string' && color.length > 0) style.color = color;
    if (shadow) classNames.push('shadow');
    let isBtn = false;
    Object.keys(props).forEach(e => {
        if (['primary', 'secondary', 'info', 'success', 'warning', 'danger', 'light', 'dark'].indexOf(e) >= 0) {
            if (outline) classNames.push(`btn btn-outline-${e}`); else
                classNames.push(`btn btn-${e}`);
            isBtn = true;
        }
        if (['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].indexOf(e) >= 0) classNames.push(e);
    });
    if (isBtn) {
        if (sm) classNames.push('btn-sm');
        if (lg) classNames.push('btn-lg');
    }
    return /*#__PURE__*/(
        React.createElement(React.Fragment, null, /*#__PURE__*/
            React.createElement("style", null, `#${id}{position:relative;text-decoration:none;}#${id}:hover{text-decoration:none;}#${id}:before{content:"";position:absolute;width:100%;height:.2rem;bottom:0;left:0;background-color:currentColor;visibility:hidden;transform:scaleX(0);transition:all 0.3s ease-in-out 0s;-webkit-transform:scaleX(0);-webkit-transition:all 0.3s ease-in-out 0s;}#${id}:hover:before{visibility:visible;-webkit-transform:scaleX(1);transform:scaleX(1);}`), /*#__PURE__*/
            React.createElement("a", { id: id, href: href, className: classNames.join(' '), style: style, target: target || blank ? '_blank' : '', title: title || !target && blank ? 'Open in New Tab' : '' }, label || children)));
}
function Callout(props) {
    const { title = '', children, className = '', shadow = false } = props;
    const classNames = ['callout'];
    Object.keys(props).forEach(e => {
        if (['primary', 'secondary', 'info', 'success', 'warning', 'danger', 'light', 'dark'].indexOf(e) >= 0) {
            classNames.push(`callout-${e}`);
        }
    });
    if (shadow) {
        classNames.push('shadow');
    }
    return /*#__PURE__*/(
        React.createElement("div", { className: classNames.join(' ') },
            typeof title === 'string' && title.length > 0 && /*#__PURE__*/
            React.createElement("h5", null, title), /*#__PURE__*/
            React.createElement("p", null, children)));
}
ReactDOM.render( /*#__PURE__*/
    React.createElement(App, null),
    document.getElementById('root'));
</script>

</body>
</html>
Preview