JSFiddle - React, Tailwind, and code Playground
HTML
<form>
<input type="text"/>
<button type="submit">Send</button>
</form>
CSS
/* Create a form with the width you want */
form { position: relative; display: block; width: 50%; }
/* Make your input element encompass the whole form */
form input[type=text] { width: 100%; height: 40px; background: blue; }
form input[type=text]:focus { background: red; }
/* Use Positioning to Place the Submit over the Input */
form button { display: block; width: 50px; height: 40px; position: absolute; top: 0px; right: 0px; color: #fff; background: none; border: none; }
JavaScript
$('form').submit(function() {
return false;
});