<div id="app"></div>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  width: 100vw;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(#28a9dd, #0d4e77);
  font-family: "Share Tech Mono", monospace;
  font-size: 2rem;
}

.card {
    position: relative;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 5px;
    padding:2vw;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    transition: .3s ease;
    margin: 3vw;
}

h1 {
  position: relative;
  z-index: 1;
  border-left: 5px solid #ed2553;
  margin: 0 0 3vh -2vw;
  padding: 10px 0 10px 2vw;
  color: #ed2553;
  font-size: 32px;
  font-weight: 600;
  text-transform: uppercase;
}

p {
  font-family: "Share Tech Mono", monospace;
  margin: 1em 0;
  text-align: center;
}

input[type="text"]{
	padding: 15px;
	border: 1px solid #ccc;
	border-radius: 3px;
	margin-bottom: 10px;
	width: 100%;
	box-sizing: border-box;
	font-family: "Share Tech Mono", monospace;
	color: #2C3E50;
	font-size: 16px;
}
var App = React.createClass({
    getInitialState: function() {
        return {
            value: '大漠'
        }
    },

    onChange: function(e) {
       this.setState({
            value: e.target.value
        })
    },

    render: function() {
        return (
            <div className="card">
                <h1>使用 React.createClass 创建组件</h1>
                <input 
                    value={this.state.value}
                    type="text"
                    onChange={this.onChange}
                />
                <p>Hello, {this.state.value} (^_^)!</p>
            </div>
        )
    }
})

const rootElement = document.getElementById("app");
ReactDOM.render(<App />, rootElement);
View Compiled

External CSS

  1. https://fonts.googleapis.com/css?family=Share+Tech+Mono
  2. https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/react/15.5.0/react.min.js
  2. https://cdnjs.cloudflare.com/ajax/libs/react/15.5.0/react-dom.min.js