For functional components, there’s use TestWeb, :html which includes what your component/0 does as well as imports some functions from Phoenix.Controller.
def html do
quote do
use Phoenix.Component
# Import convenience functions from controllers
import Phoenix.Controller,
only: [get_csrf_token: 0, view_module: 1, view_template: 1]
# Include general helpers for rendering HTML
unquote(html_helpers())
end
end