HomeComponentsInput Field

Input Generator

Border Radius8px
Border Width2px
Font Size16px
<div class="input-group">
  <input type="text" id="name" required placeholder=" " />
  <label for="name">Your Name</label>
</div>
.input-group {
  position: relative;
  font-family: sans-serif;
  width: 300px;
}

.input-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;
  outline: none;
  transition: all 0.2s;
  padding-top: 24px; padding-bottom: 8px;
}

.input-group input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px #3b82f633;
}

.input-group label {
  color: #64748b;
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  transition: all 0.2s;
  pointer-events: none;
  font-size: 16px;
}


.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
  top: 8px;
  transform: none;
  font-size: 12px;
  color: #3b82f6;
  font-weight: 600;
}