# Using LiveView component inside a Phoenix template

**URL:** <https://forum.elixirforum.com/t/using-liveview-component-inside-a-phoenix-template/42787>\
**Category:** Questions\
**Tags:** phoenix, templates, liveview\
**Created:** [October 1, 2021, 5:43pm UTC](https://forum.elixirforum.com/t/using-liveview-component-inside-a-phoenix-template/42787 "2021-10-01T17:43:59Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![APB9785](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/apb9785/32/24101_2.png) [@APB9785](https://forum.elixirforum.com/u/APB9785)\
**Post date:** [October 1, 2021, 9:21pm UTC](https://forum.elixirforum.com/t/using-liveview-component-inside-a-phoenix-template/42787/2 "2021-10-01T21:21:50Z")

</div>

From [the docs](https://hexdocs.pm/phoenix_live_view/Phoenix.LiveComponent.html):

> Components are defined by using [`Phoenix.LiveComponent`](https://hexdocs.pm/phoenix_live_view/Phoenix.LiveComponent.html#content) and are used by calling [`Phoenix.LiveView.Helpers.live_component/3`](https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.Helpers.html#live_component/3) in a parent LiveView. Components run inside the LiveView process but have their own life-cycle.

It seems like you’re trying to call the LiveComponent outside of a LiveView, which doesn’t work because the LC doesn’t spawn up its own process, but instead requires a parent LV process to run inside.

For this case, perhaps a [function component](https://hexdocs.pm/phoenix_live_view/Phoenix.Component.html) would be an acceptable alternative?

---

_[View the full topic](https://forum.elixirforum.com/t/using-liveview-component-inside-a-phoenix-template/42787)._
