Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
	<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
	<title>Contact List App</title>
</head>
<body>
	<div class="container">
		<h1 class="center-align">
			<i class="medium material-icons">contacts</i> My Contacts
		</h1>
    <p class="center-align">Type a name to show search filter.</p>
		<input id="filterInput" type="text" class="text" placeholder="Search Names">
		<ul id="names" class="collection with-header">
			<li class="collection-header">
				<h5>A</h5>
			</li>
			<li class='collection-item'><a href='#'>Abigail Brennan</a></li>
			<li class='collection-item'><a href='#'>Adrien Freeman</a></li>
			<li class='collection-item'><a href='#'>Aidan Hardin</a></li>
			<li class='collection-item'><a href='#'>Alina Gould</a></li>
			<li class='collection-item'><a href='#'>Allan Mathews</a></li>
			<li class='collection-item'><a href='#'>Amari Brock</a></li>
			<li class='collection-item'><a href='#'>Amari Mcclure</a></li>
			<li class='collection-item'><a href='#'>Ari Ryan</a></li>
			<li class='collection-item'><a href='#'>Ariel Rice</a></li>
			<li class='collection-item'><a href='#'>Atticus Montes</a></li>
			<li class='collection-item'><a href='#'>Aubree Kirby</a></li>
			<li class="collection-header">
				<h5>B</h5>
			</li>
			<li class='collection-item'><a href='#'>Bailey Beard</a></li>
			<li class='collection-item'><a href='#'>Beatrice Faulkner</a></li>
			<li class='collection-item'><a href='#'>Braylen Rhodes</a></li>
			<li class='collection-item'><a href='#'>Brice Gates</a></li>
			<li class='collection-item'><a href='#'>Briley Molina</a></li>
			<li class="collection-header">
				<h5>C</h5>
			</li>
			<li class='collection-item'><a href='#'>Cadence Mcmahon</a></li>
			<li class='collection-item'><a href='#'>Camilla Mora</a></li>
			<li class='collection-item'><a href='#'>Camryn Irwin</a></li>
			<li class='collection-item'><a href='#'>Carl Case</a></li>
			<li class='collection-item'><a href='#'>Ciara Beard</a></li>
			<li class='collection-item'><a href='#'>Clarence Barnett</a></li>
			<li class='collection-item'><a href='#'>Courtney Mcintosh</a></li>
			<li class='collection-item'><a href='#'>Cynthia Raymond</a></li>
			<li class="collection-header">
				<h5>D</h5>
			</li>
			<li class='collection-item'><a href='#'>Danielle Novak</a></li>
			<li class='collection-item'><a href='#'>Dayami Watkins</a></li>
			<li class='collection-item'><a href='#'>Deja Humphrey</a></li>
			<li class='collection-item'><a href='#'>Devyn Hancock</a></li>
			<li class="collection-header">
				<h5>E</h5>
			</li>
			<li class='collection-item'><a href='#'>Eduardo Lloyd</a></li>
			<li class='collection-item'><a href='#'>Elyse Tran</a></li>
			<li class='collection-item'><a href='#'>Eric Bradshaw</a></li>
			<li class='collection-item'><a href='#'>Erin Gutierrez</a></li>
			<li class="collection-header">
				<h5>F</h5>
			</li>
			<li class='collection-item'><a href='#'>Fatima Bonilla</a></li>
			<li class='collection-item'><a href='#'>Fiona Pacheco</a></li>
			<li class='collection-item'><a href='#'>Francis Owen</a></li>
			<li class="collection-header">
				<h5>G</h5>
			</li>
			<li class='collection-item'><a href='#'>Gael Lindsey</a></li>
			<li class='collection-item'><a href='#'>Gemma Schmitt</a></li>
			<li class='collection-item'><a href='#'>Gregory Rodgers</a></li>
			<li class="collection-header">
				<h5>H</h5>
			</li>
			<li class='collection-item'><a href='#'>Hope Atkinson</a></li>
			<li class='collection-item'><a href='#'>Howard Preston</a></li>
			<li class='collection-item'><a href='#'>Hudson Duffy</a></li>
			<li class="collection-header">
				<h5>I</h5>
			</li>
			<li class='collection-item'><a href='#'>Ingrid Fernandez</a></li>
			<li class='collection-item'><a href='#'>Iyana Payne</a></li>
			<li class="collection-header">
				<h5>J</h5>
			</li>
			<li class='collection-item'><a href='#'>Jaliyah Mullins</a></li>
			<li class='collection-item'><a href='#'>Janiah Holden</a></li>
			<li class='collection-item'><a href='#'>Jared Hayden</a></li>
			<li class='collection-item'><a href='#'>Jason Kane</a></li>
			<li class='collection-item'><a href='#'>Jean Mccann</a></li>
			<li class='collection-item'><a href='#'>Jenny Ramsey</a></li>
			<li class='collection-item'><a href='#'>Joey White</a></li>
			<li class="collection-header">
				<h5>K</h5>
			</li>
			<li class='collection-item'><a href='#'>Kael Gibson</a></li>
			<li class='collection-item'><a href='#'>Kai Kennedy</a></li>
			<li class='collection-item'><a href='#'>Kaia Cameron</a></li>
			<li class='collection-item'><a href='#'>Kaitlin Gordon</a></li>
			<li class='collection-item'><a href='#'>Kasey Rush</a></li>
			<li class='collection-item'><a href='#'>Kayden Clements</a></li>
			<li class='collection-item'><a href='#'>Keaton Rich</a></li>
			<li class='collection-item'><a href='#'>Kendall Glenn</a></li>
			<li class='collection-item'><a href='#'>Kendra Carr</a></li>
			<li class='collection-item'><a href='#'>Kenley Madden</a></li>
			<li class='collection-item'><a href='#'>Kenyon Haynes</a></li>
			<li class='collection-item'><a href='#'>Keshawn Quinn</a></li>
			<li class='collection-item'><a href='#'>Kingston Bolton</a></li>
			<li class="collection-header">
				<h5>L</h5>
			</li>
			<li class='collection-item'><a href='#'>Lawrence Osborn</a></li>
			<li class='collection-item'><a href='#'>Layton Robbins</a></li>
			<li class='collection-item'><a href='#'>Leah Bray</a></li>
			<li class='collection-item'><a href='#'>Leia Juarez</a></li>
			<li class='collection-item'><a href='#'>Lila Wang</a></li>
			<li class='collection-item'><a href='#'>Luz Smith</a></li>
			<li class="collection-header">
				<h5>M</h5>
			</li>
			<li class='collection-item'><a href='#'>Maci Giles</a></li>
			<li class='collection-item'><a href='#'>Malaki Velez</a></li>
			<li class='collection-item'><a href='#'>Mallory Andrews</a></li>
			<li class='collection-item'><a href='#'>Manuel Atkins</a></li>
			<li class='collection-item'><a href='#'>Marley Holmes</a></li>
			<li class='collection-item'><a href='#'>Melvin Leblanc</a></li>
			<li class='collection-item'><a href='#'>Milton Mason</a></li>
			<li class='collection-item'><a href='#'>Mira Dunn</a></li>
			<li class="collection-header">
				<h5>N</h5>
			</li>
			<li class='collection-item'><a href='#'>Nyasia Hart</a></li>
			<li class="collection-header">
				<h5>O</h5>
			</li>

			<li class="collection-header">
				<h5>P</h5>
			</li>
			<li class='collection-item'><a href='#'>Payton Frey</a></li>
			<li class='collection-item'><a href='#'>Perla Woods</a></li>
			<li class="collection-header">
				<h5>Q</h5>
			</li>

			<li class="collection-header">
				<h5>R</h5>
			</li>
			<li class='collection-item'><a href='#'>Ramiro Orozco</a></li>
			<li class='collection-item'><a href='#'>Randall Vargas</a></li>
			<li class='collection-item'><a href='#'>Reed Day</a></li>
			<li class='collection-item'><a href='#'>Rigoberto Mosley</a></li>
			<li class='collection-item'><a href='#'>Rowan Miles</a></li>
			<li class='collection-item'><a href='#'>Ryan May</a></li>
			<li class="collection-header">
				<h5>S</h5>
			</li>
			<li class='collection-item'><a href='#'>Salvatore Li</a></li>
			<li class='collection-item'><a href='#'>Skyla Stanley</a></li>
			<li class='collection-item'><a href='#'>Skyler Hatfield</a></li>
			<li class='collection-item'><a href='#'>Solomon Conrad</a></li>
			<li class='collection-item'><a href='#'>Sullivan Kerr</a></li>
			<li class="collection-header">
				<h5>T</h5>
			</li>
			<li class='collection-item'><a href='#'>Talan Hughes</a></li>
			<li class='collection-item'><a href='#'>Taliyah Huerta</a></li>
			<li class='collection-item'><a href='#'>Todd Wilkinson</a></li>
			<li class='collection-item'><a href='#'>Trevin Salinas</a></li>
			<li class="collection-header">
				<h5>U</h5>
			</li>
			<li class='collection-item'><a href='#'>Uriah Trujillo</a></li>
			<li class="collection-header">
				<h5>V</h5>
			</li>
			<li class='collection-item'><a href='#'>Vanessa Shaffer</a></li>
			<li class='collection-item'><a href='#'>Vivian Whitney</a></li>
			<li class="collection-header">
				<h5>W</h5>
			</li>
			<li class='collection-item'><a href='#'>Walter Haynes</a></li>
			<li class="collection-header">
				<h5>X</h5>
			</li>

			<li class="collection-header">
				<h5>Y</h5>
			</li>

			<li class="collection-header">
				<h5>Z</h5>
			</li>
			<li class='collection-item'><a href='#'>Zander Knox</a></li>
						
		</ul>
	</div>
	<div class="container">
		
	</div>
</body>
</html>
            
          
!
            
              i.material-icons{
  margin-right: .2em;
}
            
          
!
            
              //Get input element
		let filterInput = document.getElementById('filterInput');
		//Add event listener
		filterInput.addEventListener('keyup', filterNames);

		function filterNames(){
			//Get value of input
			let filterValue = document.getElementById('filterInput').value.toUpperCase();
			//Get names ul
			let ul = document.getElementById('names');
			//Get names li
			let li = ul.querySelectorAll('li.collection-item');
			//Loop through li
			for(let i = 0; i < li.length; i++){
				let a = li[i].getElementsByTagName('a')[0];
				//If matched
				if(a.innerHTML.toUpperCase().indexOf(filterValue) > -1){
					li[i].style.display = '';
				}else{
					li[i].style.display = 'none';
				}
			}
		};
		//Add icon to lists
		let li = document.querySelectorAll('li.collection-item');
		li.forEach(function(element){
			let i = document.createElement('i');
			i.innerHTML = 'account_circle';
			i.classList.add('material-icons');
			element.insertBefore(i, element.childNodes[0]);
			element.classList.add('valign-wrapper');
		});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console