JSFiddle - React, Tailwind, and code Playground
by gwendall
HTML
<script src="https://rawgit.com/gwendall/way.js/master/way.bundle.min.js"></script>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<body>
<div class="container-fluid">
<div class="row">
<div style="margin-left: 25px;">
Read more about it in the <a href="https://github.com/gwendall/way.js" target="_blank">Github repo</a>
</div>
<div class="col-sm-6">
<div class="alert alert-warning">way form</div>
<form role="form" class="form-horizontal" way-data="formData" way-persistent="true">
<div class="form-group">
<label class="col-sm-3">Name</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="name" placeholder="Name" autocomplete="off">
</div>
</div>
<div class="form-group">
<label class="col-sm-3">Picture</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="picture" placeholder="Enter an image's URL" autocomplete="off">
<img class="img-responsive" way-data="formData.picture" way-default="http://creditworksusa.com/wp-content/uploads/2014/03/facebook-default-profile-photo.jpg">
</div>
</div>
<div class="form-group">
<label class="col-sm-3">Nationality</label>
<div class="col-sm-9 checkbox">
<label>
<input type="checkbox" name="nationality[]" value="french">French<br/>
</label>
<label>
<input type="checkbox" name="nationality[]" value="american">American<br/>
</label>
<label>
<input type="checkbox" name="nationality[]" value="british">British<br/>
</label>
<label>
<input type="checkbox" name="nationality[]" value="chinese">Chinese<br/>
</label>
...
CSS
body {
padding: 20px;
}
.alert {
margin: 20px 0px;
}
.checkbox label {
display: block;
}
form {
margin-bottom: 20px;
}
img {
margin-top: 20px;
background: rgba(0, 0, 0, .1);
width: 200px;
}
}
JavaScript
// nope nope nope, not a single line of JS code