KinoLiveComponent
Mix.install(
[
{:kino_live_component, "~> 0.0.3"}
],
config: [
kino_live_component: [
endpoint: "http://localhost:9999/kino-live-component"
]
]
)
Phoenix.Component
import Phoenix.Component, only: [sigil_H: 2]
assigns = %{
content: "Hello, Phoenix component!"
}
~H"""
<%= @content %>
"""
|> KinoLiveComponent.component()
Phoenix.LiveComponent
defmodule MyLiveComponent do
use Phoenix.LiveComponent
def render(assigns) do
~H"""
<%= @content %>
"""
end
end
assigns = %{
content: "Hello, Phoenix live component!"
}
KinoLiveComponent.component(MyLiveComponent, assigns)