web-state-jotai
Jotai Atomic State Management
Quick Guide: Jotai provides atomic, bottom-up state management with automatic dependency tracking. Define atoms at module level (never inside components). Use primitive atoms for values, derived atoms for computed state, write-only atoms for actions, and async atoms with Suspense for loading. Components only re-render when their specific atoms change. The
atomFamilyutility is deprecated -- use thejotai-familypackage for new code.
<critical_requirements>
CRITICAL: Before Using Jotai
(You MUST define atoms OUTSIDE components -- creating atoms inside render causes broken state)
(You MUST wrap async atom consumers in Suspense boundaries -- async atoms trigger Suspense by default)
(You MUST use write atoms (action atoms) to encapsulate multi-atom updates and post-async state changes)
(You MUST use jotai-family package instead of deprecated atomFamily from jotai/utils for new code)
</critical_requirements>
More from agents-inc/skills
web-animation-css-animations
CSS Animation patterns - transitions, keyframes, scroll-driven animations, @property, GPU-accelerated properties, accessibility with prefers-reduced-motion
24web-animation-view-transitions
View Transitions API patterns - same-document transitions, cross-document MPA transitions, shared element animations, pseudo-element styling, accessibility
21web-testing-playwright-e2e
Playwright E2E testing patterns - test structure, Page Object Model, locator strategies, assertions, network mocking, visual regression, parallel execution, fixtures, and configuration
21web-styling-cva
Class Variance Authority - type-safe component variant styling with cva(), compound variants, and VariantProps
20web-animation-framer-motion
Motion (formerly Framer Motion) animation patterns - motion components, variants, gestures, layout animations, scroll-linked animations, accessibility
20web-i18n-next-intl
Type-safe i18n for Next.js App Router
19