Prévisualisation
<div class="messageBox">
<div class="fileUploadWrapper">
<label for="file">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 337 337">
<circle stroke-width="20" stroke="#6c6c6c" fill="none" r="158.5" cy="168.5" cx="168.5"></circle>
<path stroke-linecap="round" stroke-width="25" stroke="#6c6c6c" d="M167.759 79V259"></path>
<path stroke-linecap="round" stroke-width="25" stroke="#6c6c6c" d="M79 167.138H259"></path>
</svg>
<span class="tooltip">Add an image</span>
</label>
<input type="file" id="file" name="file" />
</div>
<input required="" placeholder="Message..." type="text" id="messageInput" />
<button id="sendButton">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 664 663">
<path fill="none" d="M646.293 331.888L17.7538 17.6187L155.245 331.888M646.293 331.888L17.753 646.157L155.245 331.888M646.293 331.888L318.735 330.228L155.245 331.888"></path>
<path stroke-linejoin="round" stroke-linecap="round" stroke-width="33.67" stroke="#6c6c6c" d="M646.293 331.888L17.7538 17.6187L155.245 331.888M646.293 331.888L17.753 646.157L155.245 331.888M646.293 331.888L318.735 330.228L155.245 331.888"></path>
</svg>
</button>
</div>
.messageBox {
width: fit-content;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
background-color: #2d2d2d;
padding: 0 15px;
border-radius: 10px;
border: 1px solid rgb(63, 63, 63);
}
.messageBox:focus-within {
border: 1px solid rgb(110, 110, 110);
}
.fileUploadWrapper {
width: fit-content;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
font-family: Arial, Helvetica, sans-serif;
}
#file {
display: none;
}
.fileUploadWrapper label {
cursor: pointer;
width: fit-content;
height: fit-content;
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.fileUploadWrapper label svg {
height: 18px;
}
.fileUploadWrapper label svg path {
transition: all 0.3s;
}
.fileUploadWrapper label svg circle {
transition: all 0.3s;
}
.fileUploadWrapper label:hover svg path {
stroke: #fff;
}
.fileUploadWrapper label:hover svg circle {
stroke: #fff;
fill: #3c3c3c;
}
.fileUploadWrapper label:hover .tooltip {
display: block;
opacity: 1;
}
.tooltip {
position: absolute;
top: -40px;
display: none;
opacity: 0;
color: white;
font-size: 10px;
text-wrap: nowrap;
background-color: #000;
padding: 6px 10px;
border: 1px solid #3c3c3c;
border-radius: 5px;
box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.596);
transition: all 0.3s;
}
#messageInput {
width: 200px;
height: 100%;
background-color: transparent;
outline: none;
border: none;
padding-left: 10px;
color: white;
}
#messageInput:focus ~ #sendButton svg path,
#messageInput:valid ~ #sendButton svg path {
fill: #3c3c3c;
stroke: white;
}
#sendButton {
width: fit-content;
height: 100%;
background-color: transparent;
outline: none;
border: none;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.3s;
}
#sendButton svg {
height: 18px;
transition: all 0.3s;
}
#sendButton svg path {
transition: all 0.3s;
}
#sendButton:hover svg path {
fill: #3c3c3c;
stroke: white;
}
License MIT
Original author:
vinodjangid07
Copyright - 2026 vinodjangid07 (Vinod Jangid)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.