8808 shaares
198 private links
198 private links
User-facing state is what someone experiences when they interact with (or try to interact with) an element in some capacity. It is reactive, helping to communicate the ways in which something can be manipulated.
It is also worth noting that on the web, the majority of user-facing state can be communicated programatically. This means that there is an HTML attribute or ARIA declaration that can ensure people who can’t see the content can understand the state something has been set to.
It is different from the application state.
The states:
- resting: the status of something before someone has interacted with it, or other content affects it. Oftentimes referred to as “Base” or “Default.”
- hovered
- active
- focused
- visited
- loading / loaded
- disabled
- hidden
- readonly
- enabled
- checked: marked for sending as data to another internal or external resource. Can be focused, but keeps it's selected state after focus is moved
- unchecked
- undeterminate
- selected / deselected
- dragged / dropped
- collapsed / expanded
- resizing
- dirty: an editable element that has been manipulated on one or more occurences
- pristine: editable element has yet to be manipulated by someone
- saving
- overflowing
- scrolling
- playing / paused / stopped
- sticky
- unstuck: sticky element removed from a side of the viewport back it its original position