Skip to content

Variable: ARIA_STATE ​

ts
const ARIA_STATE: Regex<"\\[\\s*(?<attr>aria-[\\w-]+|data-state)\\s*=\\s*[\"']?(?<value>[^\"']*)", {
  flags: "u";
  names: {
     attr: string;
     value: string;
  };
}>;

Defined in: packages/regex/src/tiers/cssdoc-local.ts:66

ARIA State Attribute Pattern Matches ARIA state and data-state attributes. Used to extract state information from attribute selectors.

Example attributes:

  • [aria-disabled="true"]
  • [aria-pressed="false"]
  • [data-state="active"]

Example ​

ts
ARIA_STATE.exec('[aria-disabled="true"]')?.groups // { attr: "aria-disabled", value: "true" }

Released under the MIT License