Named states
Set named states like menu-open or tab=2 that CSS, other interactions and conditions can read.
A state is a named value for the page, such as menu: open or tab: pricing. The State action sets, toggles or clears it, and the On State event and the Only If State condition react to it. The state appears on the page as a data-state-<name> attribute, so classes can style it, and it can be kept for the session. States make menus, tabs, accordions and modals coordinate without code.
How it works
- State action: type set, toggle or clear; state name (small letters, digits and -); value (up to 200 characters); persist none or session.
- A kept state comes back after a reload: data-state-* is set again and the On State event runs once marked as restored, with interactions jumping to their end state.
- On State event: filter by state name and an equals value.
- Interaction condition 'if' (Only If State): equals or not equal to a value; it holds on every event.
- Accessible presets built on states (MCP): accordion and tabs presets are exposed; modal, mega-menu, tabs-keyboard, reveal, parallax and hover-lift presets exist but are not exposed yet.
When to use it
- One menu-open state shared by the burger button, the overlay and the body scroll lock
- Tabs where buttons and panels follow a tab state
- Remember a dismissed banner for the session
Limitations
- Persistence is session only (no long-term storage option).
Availability
- Works in Designer and MCP.
- Included in every plan.
How to use it.
- Add a State action that sets a name and value.
- Add an interaction on On State, or use Only If State in Scope, to react.
Questions.
Can CSS react to a state?
Related features.
Interactions
Build animations and behaviour without code: pick an event, then chain actions like animate, class, show/hide or scroll.
Interaction scope
Limit an interaction to certain pages, screen sizes, pointer types or a named state.
Accessible menus and modals
Focus trap, focus return, scroll lock, Escape and outside-press handling for menus and dialogs, without code.
Browse other features
Designer
Bring your ideas to life with our visual website builder. Drag and drop with ease, or dive into coding when needed.
→AI Studio
Describe it and AI builds it. Every change lands in the same project you can open in the Designer.
→MCP
Connect Claude Code, Cursor or any MCP client and build whole sites with your own agent.
→CMS
Create, organize, and manage your dynamic content with the maximum freedom and flexibility of our visual CMS.
→SEO
Divhunt delivers ultra-fast & structured sites that are good for ranking by default, while offering complete control for customization.
→REST API
Easily link to any REST API endpoint with instant preview and expand your site’s functionality smoother than ever before.
→Plugins
Divhunt offers an open platform for creating plugins to upgrade features, add new capabilities, and simplify building better sites.
→Localization
Localize everything from static pages and CMS content to URLs and metadata, in up to 15 languages with no add-on.
→Interactions
Visually create animations and interactions with a simple, intuitive timeline. Build smooth, engaging experiences without code.
→Custom Files
Manage JS and CSS files with a structure developers love, combining folders and clean organization.
→Memberships
Create plans, decide who sees what and connect it all to your CMS. Build courses, communities or client portals.
→