# `Surface.LiveView`
[🔗](https://github.com/surface-ui/surface/blob/v0.12.3/lib/surface/live_view.ex#L1)

A wrapper component around `Phoenix.LiveView`.

Since this module is just a wrapper around `Phoenix.LiveView`, you
cannot define custom properties for it. Only `:id` and `:session`
are available. However, built-in directives like `:for` and `:if`
can be used normally.

## Example

    defmodule Example do
      use Surface.LiveView

      def render(assigns) do
        ~F"""
        <Dialog title="Alert" id="dialog">
          This <b>Dialog</b> is a stateful component. Cool!
        </Dialog>

        <Button click="show_dialog">Click to open the dialog</Button>
        """
      end

      def handle_event("show_dialog", _, socket) do
        Dialog.show("dialog")
        {:noreply, socket}
      end
    end

---

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