Skip to content

No.451 · Forms

Etched Field

A text field whose label rises into a notch cut from the top border, with a frost outline that draws in on focus.

The prompt

Copy this text

Automatic copying is unavailable. Copy the selected text using your device’s copy command.

The design brief behind this component — reuse it to regenerate, remix, or explain it.

Design a text input that feels engraved. A 56px field with a hairline cream border and 10px radius. The label sits inside the field like a placeholder; when the field is focused or filled it rises 2.1rem and scales to 78% so it lands on the top border, and a 2px strip of the page colour behind it "cuts" the border so the label appears set into a notch. On focus the hairline border is replaced by a frost-blue outline that draws itself in from left to right (clip-path inset over 420ms, ease-out-expo) plus a soft 4px halo. A tiny mono mark at the right shows state in more than colour: ✓ when filled, ! when invalid. Invalid turns the border, label, mark and message rose and shows a role=alert message; a hint can sit below in muted text. It is a real <input> with a real <label>, aria-invalid and aria-describedby wiring, and works with browser autofill (the :not(:placeholder-shown) selector floats the label for autofilled values). Implementation requirements: Use React and TypeScript. Keep the component self-contained, with uniquely scoped CSS and no animation libraries. Include required imports, styles and font setup in the result. Interaction: Focus draws the outline and lifts the label; typing sets the check mark; errors swap in the rose state. Motion: Label rise 280ms ease-out-expo; outline draw 420ms; halo/colour 200–250ms. Accessibility: Native input + label association; aria-invalid and aria-describedby; state conveyed by icon as well as colour; error is role=alert. Reduced motion shortens transitions to 1ms. Responsive behavior: Fills its container. Preserve keyboard access, visible focus and reduced-motion behavior. Keep fictional demo data and simulated service calls in a separate usage example; expose callbacks for real actions and recover from rejected requests. Keep usage-example links inside the demo: use local buttons or prevent navigation. Demonstration links must not navigate to Vitrine routes or open other pages; preserve real URL support in the reusable component itself. Verify the result at narrow and wide viewport sizes, with keyboard input and reduced motion enabled.

Notes

Interaction
Focus draws the outline and lifts the label; typing sets the check mark; errors swap in the rose state.
Motion
Label rise 280ms ease-out-expo; outline draw 420ms; halo/colour 200–250ms.
Accessibility
Native input + label association; aria-invalid and aria-describedby; state conveyed by icon as well as colour; error is role=alert. Reduced motion shortens transitions to 1ms.
Responsive
Fills its container.