Skip to main content
CSS-Tricks
Since 2007
  • Articles
  • Guides
  • Almanac
  • Links
  • Picks
  • Newsletter
  • Search

Articles Tagged
state

10 Articles
{
,

}
Direct link to the article The Radio State Machine
checkbox hack forms state state machines

The Radio State Machine

One of the best-known examples of CSS state management is the checkbox hack. What if we want a component to be in one of three, four, or seven modes? That is where the Radio State Machine comes in.
Amit Sheen on Apr 14, 2026
Direct link to the article Takes on State
state state management

Takes on State

React is actually a bit of an outlier with state management. While it has first-class tools like useState and Context, you’re more own your own for reactive global state. Here’s David Ceddia with “React State Management Libraries and How …

Chris Coyier on Mar 24, 2021
Direct link to the article useStateInCustomProperties
custom properties state

useStateInCustomProperties

In my recent “Custom Properties as State” post, one of the things I mentioned was that theoretically, UI libraries, like React and Vue, could automatically map the state they manage over to CSS Custom Properties so we could use that state …

Chris Coyier on Jan 21, 2021
Direct link to the article Custom Properties as State
custom properties state

Custom Properties as State

Here’s a fun idea from James Stanley: a CSS file (that presumably updates daily) containing CSS custom properties for “seasonal” colors (e.g. spring is greens, fall is oranges). You’d then use the values to theme your site, knowing that those …

Chris Coyier on Jan 5, 2021
Direct link to the article A Complete State Machine Made With HTML Checkboxes and CSS
state state machines state management

A Complete State Machine Made With HTML Checkboxes and CSS

State machines are typically expressed on the web in JavaScript and often through the popular XState library. But the concept of a state machine is adaptable to just about any language, including, amazingly, HTML and CSS. In this article, we’re …

Ryan Bethel on Nov 27, 2020
Direct link to the article Model-Based Testing in React with State Machines
JavaScript react state state machines testing xstate

Model-Based Testing in React with State Machines

Testing applications is crucially important to ensuring that the code is error-free and the logic requirements are met. However, writing tests manually is tedious and prone to human bias and error. Furthermore, maintenance can be a nightmare, especially when features …

David Khourshid on Sep 4, 2019
Direct link to the article Managing State in React With Unstated
react state state management

Managing State in React With Unstated

As your application becomes more complex, the management of state can become tedious. A component’s state is meant to be self-contained, which makes sharing state across multiple components a headache. Redux is usually the go-to library to manage state in …

Kingsley Silas on May 29, 2018
Direct link to the article Understanding React `setState`
react state state management

Understanding React `setState`

React components can, and often do, have state. State can be anything, but think of things like whether a user is logged in or not and displaying the correct username based on which account is active. Or an array …

Kingsley Silas on Apr 25, 2018
Direct link to the article User Facing State
accessibility state

User Facing State

Let’s talk about state. Communicating state to the user that is, not application stores state in JavaScript objects, or localStorage. We’re going to be talking about how to let our users know about state (think: whether a button is …

Scott O'Hara on May 19, 2017
  • 1
  • 2
  • Older

CSS-Tricks is powered by DigitalOcean.

Get Curated Front-End Roundups Right in Your Inbox

Coming back really, really soon! See past issues →

DigitalOcean
  • About DO
  • Cloudways
  • Legal stuff
  • Get free credit!
CSS-Tricks
  • Contact
  • Write for CSS-Tricks!
Social
  • RSS Feeds
  • CodePen
  • Mastodon
  • Bluesky
Back to Top