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


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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


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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <div id="app"></div>


                html {
  height: 100%;
  box-sizing: border-box;

*:after {
  box-sizing: inherit;

#custom-search-input {
  margin: 40px 7% 0 7%;
  padding: 0;

#custom-search-input .search-query {
  padding-right: 3px;
  padding-right: 4px \9;
  padding-left: 3px;
  padding-left: 4px \9;
  /* IE7-8 doesn't have border-radius, so don't indent the padding */

  margin-bottom: 0;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px;

.search-query:focus + button {
  z-index: 3;

.search-result {
  border-radius: 28px 0px 0px 0px;
  border: 1px solid;
  display: inline-block;
  padding: 8px 8px 0 8px;
  margin: 20px 10%;
  color: black;
  background: #CCC;
  -webkit-box-shadow: 5px 5px 5px 0px rgba(0,0,0,0.75);
  -moz-box-shadow: 5px 5px 5px 0px rgba(0,0,0,0.75);
  box-shadow: 5px 5px 5px 0px rgba(0,0,0,0.75);

.search-result:hover {
  cursor: pointer;
  background: #efa7a7;
  margin: 22px 8% 18px 12%;
  -webkit-box-shadow: 0px 0px 22px 0px rgba(14,25,240,1);
  -moz-box-shadow: 0px 0px 22px 0px rgba(14,25,240,1);
  box-shadow: 0px 0px 22px 0px rgba(14,25,240,1);

a:link {
  text-decoration: none !important

body {
  background-image: url(;
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  margin: 0;
  padding-bottom: 6rem;
  min-height: 100%;

hr {
  padding: 0;
  margin: 2px;
  border-top: 1px solid #000;

.error {
  margin-top: 40px;
  text-align: center;
  font-size: 20px;
  font-color: red;

.error-term {
  font-style: italic;
  color: red;

footer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 1rem;



                class WikipediaViewer extends React.Component {
  constructor(props) {

    this.state = {
      term: "",
      headers: [],
      descriptions: [],
      links: [],  
      loading: true,
      error: "No articles fetched"
  onInputChange(term) {
    this.setState({ term });
    const url = "";
    const query =`${url}action=opensearch&search=${term}&prop=revisions&rvprop=content&origin=*&format=json`;
  fetchData(query) {
    console.log("Das ist die query", query)
      .then(articles => {
        console.log("Erfolg?", articles);
        if (Array.isArray( &&["1"].length > 0) {
          this.setState({ headers:["1"] } );
          this.setState({ descriptions:["2"] } );
          this.setState({ links:["3"] } );
          this.setState({ loading: false });
        } else {
          console.log("Error: ",
            error: "Sorry, no articles found for ",
            loading: true,
            headers: []
      .catch(error => {
        console.log("Error: ", error)
          loading: true,
          headers: []

  render() {
    return (
      <div className="container">
        <div className="row">
          <div id="custom-search-input">
            <div className="input-group col-lg-12">
              <input type="text" className="search-query form-control"
                placeholder="Just enter a searchterm here..."
                value={ this.state.term }
                onChange={ text => this.onInputChange( } />
              <span className="input-group-addon">
                <span className=" glyphicon glyphicon-search" />
        <div id="search-results" className="row">
          <div className="row">
            { this.state.loading && !this.state.headers.length > 0 ?
                <div className="col-lg-12 error">{ this.state.error } <span className="error-term">{ this.state.term }</span></div> :
      , key) => {
                  return (
                    <a href={ this.state.links[key] } target="_blank">
                      <div key={ key } className="col search-result">
                        <h4><strong>{ header }</strong></h4>
                        <hr />
                        <p>{ this.state.descriptions[key] }</p>
        <footer className="footer">
            Created by:
            <a href="" target="_blank">
          <p><time>{new Date().getFullYear()}</time></p>

ReactDOM.render(<WikipediaViewer />, document.getElementById("app"));