# `Doggo.JS`
[🔗](https://github.com/woylie/doggo/blob/0.18.4/lib/doggo/js.ex#L1)

Commands for the JavaScript hooks of the components, to use in `phx-click`
and other bindings.

# `hide_modal`
*since 0.18.0* 

```elixir
@spec hide_modal(Phoenix.LiveView.JS.t(), String.t()) :: Phoenix.LiveView.JS.t()
```

Hides the modal with the given ID.

The component needs its JavaScript hook registered, since this function uses
the hook to call `close()` on the dialog.

## Example

```heex
<.link phx-click={Doggo.JS.hide_modal("pet-modal")}>hide</.link>
```

# `show_modal`
*since 0.18.0* 

```elixir
@spec show_modal(Phoenix.LiveView.JS.t(), String.t()) :: Phoenix.LiveView.JS.t()
```

Shows the modal with the given ID.

The component needs its JavaScript hook registered, since this function uses
the hook to call `showModal()` on the dialog.

## Example

```heex
<.link phx-click={Doggo.JS.show_modal("pet-modal")}>show</.link>
```

# `show_tab`
*since 0.18.0* 

```elixir
@spec show_tab(Phoenix.LiveView.JS.t(), String.t(), integer()) ::
  Phoenix.LiveView.JS.t()
```

Shows the tab with the given index of the `tabs/1` component with the given
ID.

The index is one-based. The component needs its JavaScript hook registered,
since this function uses the hook to select the tab.

## Example

    Doggo.JS.show_tab("my-tabs", 2)

---

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