# `PhxDemo.Target`
[🔗](https://github.com/thenatespack/phoenix_demo/blob/main/lib/phx_demo/target.ex#L1)

Turns demo targets into Playwright selectors.

  * `"#post_title"`: any CSS or Playwright selector string, used as-is
  * `{:link, "New Post"}`: a link with that accessible name
  * `{:button, "Save"}`: a button with that accessible name
  * `{:label, "Title"}`: the form control for that label
  * `{:text, "Hello"}`: an element containing that text
  * `{:role, "heading", "Posts"}`: any ARIA role and name

Name matching is case-insensitive and substring-based (Playwright's default)
unless you pass `exact: true` as a third element, e.g. `{:link, "Post", exact: true}`.

# `t`

```elixir
@type t() ::
  String.t()
  | {:link | :button | :label | :text, String.t()}
  | {:link | :button | :label | :text, String.t(), keyword()}
  | {:role, String.t(), String.t()}
```

# `to_selector`

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

---

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