JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script>
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input" id="customFileInput">
<label class="custom-file-label CHOOSE_FILE_LABEL BROWSE_BTN_LABEL" for="customFileInput"></label>
</div>
<div class="input-group-append">
<button class="btn btn-success UPLOAD_BTN_LABEL" type="button" id="uploadBtn"></button>
</div>
</div>
CSS
.CHOOSE_FILE_LABEL::before{content: 'Choose file';}
.BROWSE_BTN_LABEL::after{content: 'Browse';}
.UPLOAD_BTN_LABEL::after{content: 'Upload';}
JavaScript
// replace "Choose file" with the file name
document.getElementById("customFileInput").addEventListener('change', function (e)
{
e.preventDefault();
var file_input = document.getElementById("customFileInput");
var file_name = file_input.files[0].name;
var next_sibling = e.target.nextElementSibling;
next_sibling.innerText = file_name;
});