cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

              <div class="mainFrame cf">
      <div class="inner">
        <h1>Recherche avec Filtre en React.js</h1>
        <div id="Recherche"></div>
              * {
     box-sizing: border-box;

   body {
   padding: 20px;
    background: #7896AB;
    font-family: 'Prompt', sans-serif;
    font-weight: 400;
    -webkit-box-shadow: 0 0 10px 0 #6E6E6E;
    box-shadow: 0 0 10px 0 #6E6E6E;
    width: 50%;
    margin:0 auto;
    color: #45737F;
    font-weight: 700

   .cf:after {
    content: " ";
    display: table;

   .cf:after {
    clear: both;
   .filter-list {
     margin: auto;
     width: 300px;
     border-radius: 5px;
   .filter-list input {
     width: 100%;
     display: block;
     padding: 10px;
     border-radius: 5px;
     border: 0;
     font-size: 24px;
     border: 1px solid #196090;
   .filter-list input:focus {
     outline: none;
   .filter-list ul {
     margin: 0;
     padding: 0;
     background: #ACD0D2;
     border-radius: 5px;
     position: relative;
     top: 5px;
     border: 1px solid #196090;
   .filter-list ul.true {
   .filter-list ul li {
     list-style-type: none;
     margin: 0;
     color: white;
     padding: 10px 20px;
   .filter-list ul li:hover {
     background: #2980b9;
              var List = React.createClass({
  render: function(){
    return (
      <ul className={this.props.focused} >
          this.props.items.map(function(item, i) {
            return (
              <li onClick={this.props.clickLI.bind(this, i, item)} key={i}>{item}</li>

var FilteredList = React.createClass({
  filterList: function(event){
    this.setState({value: event.target.value});
    this.setState({focused: true});
    var updatedList = this.state.initialItems;
    updatedList = updatedList.filter(function(item){
      return item.toLowerCase().search(event.target.value.toLowerCase()) !== -1;
    this.setState({items: updatedList});
  getInitialState: function(){
    return {
      initialItems: [
      items: [],
      focused: false,
  onBlur: function() {
    this.setState({focused: false});
  clickLI: function(i, props) {
      value: props,
      focused: false
  componentWillMount: function(){
    this.setState({items: this.state.initialItems})
  render: function(){
    return (
      <div className="filter-list" >
        <input type="text" placeholder="Search" onChange={this.filterList} value={this.state.value} />
        <List items={this.state.items} focused={this.state.focused} clickLI={this.clickLI} />

ReactDOM.render(<FilteredList/>, document.getElementById('Recherche'));

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.


Loading ..................