---
url: /reference/packages/regex/src/namespaces/CssdocLocalPatterns/variables/CUSTOM_STATE.md
---
# Variable: CUSTOM_STATE

```ts
const CUSTOM_STATE: Regex<":state\\((?<name>[A-Za-z_][\\w-]*)\\)", {
  flags: "u";
  names: {
     name: string;
  };
}>;
```

Defined in: [packages/regex/src/tiers/cssdoc-local.ts:387](https://github.com/thedannywahl/cssdoc/blob/main/packages/regex/src/tiers/cssdoc-local.ts#L387)

Custom State Pseudo-Class Pattern
Matches `:state(name)` for custom element state styling.
Used to extract custom state name.

## Example

```ts
CUSTOM_STATE.exec(":state(selected)")?.groups?.name // "selected"
```
