Hello folks!
I have surface stateless component that look like that
defmodule MyApp.Components.PasswordInput do
use Surface.Component
use MyApp, :surface_view
prop f, :form, required: true
prop field, :atom, default: :password
prop label, :string, default: "Password"
def render(assigns) do
~F"""
... some content
"""
end
end
I try to use it in my .heex template served by Phoenix.Controller next way
...
<MyApp.Components.PasswordInput.render f={f} />
...
But looks like default values for properties doesn’t work, as well as any other options.
I have couple of questions:
- Can Surface component be used in .heex template with all available features?
- Can Surface component be rendered directly from Phoenix Controller?