KinoPhoenixLiveView (kino_phoenix_live_view v0.1.2)
Provides a simple interface for launching a Phoenix LiveView within a Kino widget.
This module handles the configuration and startup of a proxy endpoint that serves your LiveView inside an iframe. It abstracts away the complexity of setting up a full Phoenix endpoint by offering a few preset option combinations.
Usage
Call KinoPhoenixLiveView.new/1
with one of the following option sets:
Only Path (Use All Defaults)
KinoPhoenixLiveView.new(path: "/proxy/apps/{slug}")
Custom LiveView
KinoPhoenixLiveView.new(path: "/proxy/apps/{slug}", live_view: MyApp.LiveView)
Custom LiveView and Layout
KinoPhoenixLiveView.new(path: "/proxy/apps/{slug}", live_view: MyApp.LiveView, root_layout: MyApp.Layout)
Custom Router
KinoPhoenixLiveView.new(path: "/proxy/apps/{slug}", router: MyApp.Router)
Custom Endpoint
KinoPhoenixLiveView.new(path: "/proxy/apps/{slug}", endpoint: MyApp.Endpoint)
Summary
Functions
Launches the Kino Phoenix LiveView integration with various configurations.
The options you pass determine which integration variant is used.
Variants:
- Only Path: Uses defaults for LiveView, layout, router, and endpoint.
- Custom LiveView: Override the default LiveView module.
- Custom LiveView and Layout: Override both LiveView and layout.
- Custom Router: Provide your own router.
- Custom Endpoint: Provide your own endpoint.
Note: Each call must include a :path
key. Do not mix incompatible options.