Market Flash
Mega-cap AI budgets are moving from pilot projects to core planning cycles
Cyber resilience spending is climbing as boards rethink operational risk
CEO succession is turning into a valuation issue for large public companies
Payments and software deal talk is heating up again across the market
Margin discipline is still winning earnings season when demand stays intact
Web DevelopmentJames Park

Building Accessible Web Applications: A Developer Guide

Web accessibility is not just a nice-to-have — it is a legal requirement in many jurisdictions and a moral imperative. This guide covers practical techniques for building truly accessible web applications.

// Accessible modal component
function AccessibleModal({ isOpen, onClose, title, children }) {
  const modalRef = useRef(null);
  const previousFocus = useRef(null);

  useEffect(() => {
    if (isOpen) {
      previousFocus.current = document.activeElement;
      modalRef.current?.focus();

      const handleKeyDown = (e) => {
        if (e.key === "Escape") onClose();
        if (e.key === "Tab") trapFocus(e, modalRef.current);
      };

      document.addEventListener("keydown", handleKeyDown);
      return () => document.removeEventListener("keydown", handleKeyDown);
    } else {
      previousFocus.current?.focus();
    }
  }, [isOpen, onClose]);

  if (!isOpen) return null;

  return (
    <div role="dialog" aria-modal="true" aria-labelledby="modal-title"
         ref={modalRef} tabIndex={-1}>
      <h2 id="modal-title">{title}</h2>
      {children}
      <button onClick={onClose} aria-label="Close dialog">Close</button>
    </div>
  );
}

More Stories