# Replacing content\_tag() with core\_component function

**URL:** <https://forum.elixirforum.com/t/replacing-content-tag-with-core-component-function/62602>\
**Category:** Questions\
**Tags:** phoenix, html, component\
**Created:** [March 30, 2024, 6:27am UTC](https://forum.elixirforum.com/t/replacing-content-tag-with-core-component-function/62602 "2024-03-30T06:27:34Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Hermanverschooten](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hermanverschooten/32/6447_2.png) [@Hermanverschooten](https://forum.elixirforum.com/u/Hermanverschooten)\
**Post date:** [March 30, 2024, 11:51am UTC](https://forum.elixirforum.com/t/replacing-content-tag-with-core-component-function/62602/2 "2024-03-30T11:51:30Z")

</div>

I would do something like this:

```elixir
attr :status, :atom, required: true
attr :classes, :string, default: ""
defp status_icon(%{status: status} = assigns) do
  icon_name = case status do
    :open -> "hero-inbox-solid text-emerald-500"
    :closed -> "hero-lock-closed text-gray-500"
    :archived -> "hero-archive-box text-gray-500"
    _ -> "hero-question-mark-circle text-blue-500"
  end
  ~H"<span class={[icon_name, @classes]} />"
end

```

And then use it as:  
`<.status_icon status={case.status} classes="h-4 w-4" />`

---

_[View the full topic](https://forum.elixirforum.com/t/replacing-content-tag-with-core-component-function/62602)._
