# `ElementorexCms.Id`
[🔗](https://github.com/rocket4ce/elementorex_cms/blob/v0.1.0/lib/elementorex_cms/id.ex#L1)

Identifiers of document nodes.

Ids are short random strings (`"Kq2b7Rt9Lm"`) that stay stable for the life of
a node: the CSS of a node is scoped to its id (`[data-ex-id="Kq2b7Rt9Lm"]`) and
the editor selects and moves nodes by id.

# `generate`

```elixir
@spec generate() :: String.t()
```

A new random id.

# `valid?`

```elixir
@spec valid?(term()) :: boolean()
```

Whether `id` can be used as a node id: 1 to 40 letters, digits, `-` or `_`.
Anything else could break out of the attribute selectors the CSS uses.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
