/Inputs
Inputs • CSS
Focus Field
An input with a clean animated focus treatment.
Installation
Terminal
npx shadcn@latest add https://microkit.co/r/focus-input.jsonCode
TypeScript component
1export function FocusField() {2return (3<label className="demo-input">4<span>Project name</span>5<input placeholder="e.g. microkit-web" />6</label>7);8}
CSS
1.demo-input {2width: 210px;3display: block;4}5.demo-input span {6display: block;7margin: 0 0 7px;8color: #9298a1;9font: 10px ui-monospace, SFMono-Regular, Menlo, monospace;10}11.demo-input input {12width: 100%;13border: 1px solid #363a42;14border-radius: 5px;15background: #15171b;16padding: 8px;17color: #e8ebee;18font-size: 11px;19outline: 0;20}21.demo-input input:focus {22border-color: #f97316;23box-shadow: 0 0 0 3px #f9731625;24}