Cursor Rule: Web Interface Guidelines
optics/cursor-rule-web-interface-guidelinesFreeUtility
Cursor rule file for web interface guidelines.
See it running
Open the demo on optics
optics.agusmayol.com.ar/components/cursor-rule-web-interface-guidelinesInstall it
npx shadcn@latest add https://optics.agusmayol.com.ar/r/cursor-rule-web-interface-guidelines.jsonSource
1---2description: Web Interface Guidelines3globs: *4alwaysApply: false5---6Concise rules for building accessible, fast, delightful UIs Use MUST/SHOULD/NEVER to guide decisions78## Interactions910- Keyboard11 - MUST: Full keyboard support per [WAI-ARIA APG](https://www.w3.org/WAI/ARIA/apg/patterns/)12 - MUST: Visible focus rings (`:focus-visible`; group with `:focus-within`)13 - MUST: Manage focus (trap, move, and return) per APG patterns14- Targets & input15 - MUST: Hit target ≥24px (mobile ≥44px) If visual <24px, expand hit area16 - MUST: Mobile `<input>` font-size ≥16px or set:17 ```html18 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover">19 ```20 - NEVER: Disable browser zoom21 - MUST: `touch-action: manipulation` to prevent double-tap zoom; set `-webkit-tap-highlight-color` to match design22- Inputs & forms (behavior)23 - MUST: Hydration-safe inputs (no lost focus/value)24 - NEVER: Block paste in `<input>/<textarea>`25 - MUST: Loading buttons show spinner and keep original label26 - MUST: Enter submits focused text input In `<textarea>`, ⌘/Ctrl+Enter submits; Enter adds newline27 - MUST: Keep submit enabled until request starts; then disable, show spinner, use idempotency key28 - MUST: Don’t block typing; accept free text and validate after29 - MUST: Allow submitting incomplete forms to surface validation30 - MUST: Errors inline next to fields; on submit, focus first error31 - MUST: `autocomplete` + meaningful `name`; correct `type` and `inputmode`32 - SHOULD: Disable spellcheck for emails/codes/usernames33 - SHOULD: Placeholders end with ellipsis and show example pattern (eg, `+1 (123) 456-7890`, `sk-012345…`)34 - MUST: Warn on unsaved changes before navigation35 - MUST: Compatible with password managers & 2FA; allow pasting one-time codes36 - MUST: Trim values to handle text expansion trailing spaces37 - MUST: No dead zones on checkboxes/radios; label+control share one generous hit target38- State & navigation39 - MUST: URL reflects state (deep-link filters/tabs/pagination/expanded panels) Prefer libs like [nuqs](https://nuqs.dev)40 - MUST: Back/Forward restores scroll41 - MUST: Links are links—use `<a>/<Link>` for navigation (support Cmd/Ctrl/middle-click)42- Feedback43 - SHOULD: Optimistic UI; reconcile on response; on failure show error and rollback or offer Undo44 - MUST: Confirm destructive actions or provide Undo window45// … truncated
Files it writes
More from optics
All 79 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Cursor Rule: Back Endcursor-rule-back-end | optics | Utilities | Free | no deps | |
| Cursor Rule: Bulk Processingcursor-rule-bulk-processing | optics | Utilities | Free | no deps | |
| Cursor Rule: Commits Conventioncursor-rule-commits-convention | optics | Utilities | Free | no deps | |
| Cursor Rule: Front Endcursor-rule-front-end | optics | Utilities | Free | no deps | |
| Cursor Rule: Generalcursor-rule-general | optics | Utilities | Free | no deps | |
| Cursor Rule: React Optimizationcursor-rule-react-optimization | optics | Utilities | Free | no deps | |
| Get strict contextget-strict-context | optics | Utilities | Free | no deps | |
| Use auto heightuse-auto-height | optics | Utilities | Free | no deps |
