react-auto-suggest
Version:
React auto-suggest component
82 lines (64 loc) • 1.82 kB
HTML
<html>
<head lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>React Auto Suggest</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.1.13/es5-shim.min.js"> </script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.1.13/es5-sham.min.js"> </script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.2/normalize.min.css" rel="stylesheet">
<style>
*, *:before, *:after {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
html, body {
font-size: 16px;
line-height: 1.5rem;
}
.AutoSuggest {
width: 480px;
margin: 1rem;
display: inline-block;
position: relative;
}
.SearchBox {
width: 480px;
padding: .5rem 1rem;
border: 1px solid #ddd;
}
.DropDown {
z-index: 2;
width: 100%;
background: #fff;
border: 1px solid #ddd;
color: #000;
position: absolute;
-moz-box-shadow: 0 2px 5px #888;
-webkit-box-shadow: 0 2px 5px #888;
box-shadow: 0 2px 5px #888;
}
.Suggestion {
line-height: 2rem;
padding: 0 1rem;
cursor: pointer;
}
.Suggestion:hover {
background: #eee;
}
.selected {
background: #ddd;
}
.title {
color: #666;
}
.thumbnail {
float: left;
}
</style>
</head>
<body>
</body>
<script src="bundle.js"></script>
</html>