View Source Phoenix.UI.Components.Modal (Phoenix UI v0.1.9)

Provides modal component.

Link to this section Summary

Functions

Hide modal matching selector.

Renders modal component.

Show modal matching selector.

Link to this section Functions

@spec hide_modal(String.t()) :: struct()

Hide modal matching selector.

examples

Examples

iex> hide_modal(selector)
%JS{}

iex> hide_modal(js, selector)
%JS{}
Link to this function

hide_modal(js, selector)

View Source
@spec hide_modal(
  struct(),
  String.t()
) :: struct()

Renders modal component.

examples

Examples

```
<.modal id="basic_modal">
  <:header>
    <.typography variant="h2" margin={false}>
      Use Google's location service?
    </.typography>
  </:header>
  <:content>
    <.typography margin={false}>
      Let Google help apps determine location. This means sending anonymous location data to Google, even when no apps are running.
    </.typography>
  </:content>
  <:actions>
    <.button variant="text" color="slate" extend_class="mr-4">Disagree</.button>
    <.button variant="text">Agree</.button>
  </:actions>
</.modal>
```
@spec show_modal(String.t()) :: struct()

Show modal matching selector.

examples

Examples

iex> show_modal(selector)
%JS{}

iex> show_modal(js, selector)
%JS{}
Link to this function

show_modal(js, selector)

View Source
@spec show_modal(
  struct(),
  String.t()
) :: struct()