Phoenix LiveView
Phoenix LiveView enables rich, real-time user experiences with server-rendered HTML. For more information, see the initial announcement.
Note: Currently LiveView is under active development and we are focused on getting a stable and solid initial version out. For this reason, we will be accepting only bug reports in the issues tracker for now. We will open the issues tracker for features after the current milestone is ironed out.
Learning
As official guides are being developed, see our existing comprehensive docs and examples to get up to speed:
- Phoenix.LiveView docs for Elixir and JavaScript usage
- Phoenix.LiveViewTest for testing docs
- LiveView example repo with a handful of examples from Weather widgets, autocomplete search, and games like Snake or Pacman
Installation
There are currently two methods for installing LiveView. For projects that require more stability, it is recommended that you install using the installation guide on HexDocs. If you want to use the latest features, you should follow the instructions given in the markdown file here.
Browser Support
All current Chrome, Safari, Firefox, and MS Edge are supported. IE11 support is available with the following polyfills:
$ npm install --save --prefix assets mdn-polyfills url-search-params-polyfill formdata-polyfill child-replace-with-polyfill classlist-polyfill @webcomponents/template shim-keyboard-event-key
Note: The shim-keyboard-event-key
polyfill is also required for MS Edge 12-18.
// assets/js/app.js
import "mdn-polyfills/CustomEvent"
import "mdn-polyfills/String.prototype.startsWith"
import "mdn-polyfills/Array.from"
import "mdn-polyfills/NodeList.prototype.forEach"
import "mdn-polyfills/Element.prototype.closest"
import "mdn-polyfills/Element.prototype.matches"
import "child-replace-with-polyfill"
import "url-search-params-polyfill"
import "formdata-polyfill"
import "classlist-polyfill"
import "@webcomponents/template"
import "shim-keyboard-event-key"
import {Socket} from "phoenix"
import LiveSocket from "phoenix_live_view"
...