---
title: "Discussion on \"Conditional class in Phoenix Component\" | Hashnode"
description: "Discussion on \"Conditional class in Phoenix Component\". phoenix의 component를 작성하다보면 for, if 문을 사용하는 경우가 많은데 tag 뒤에 :for, :if 를 사용해서 간단하게 줄일 수 있다.\ntailwind css를 사용한 class도 경우에 따라 추가적인 class를 주고 싶을 때가 있는데 core_component.ex를 살펴보다 class에 list를 줄 수 있다는 것, 그리고 list 내부에 false인 경우 무시된다는 것을 알게 되었다.\n위에서 말한 두가지 요소를 합..."
url: "https://hashnode.com/posts/conditional-class-in-phoenix-component/643f9bbaa555a0540e78708f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Conditional class in Phoenix Component](https://clue.hashnode.dev/conditional-class-in-phoenix-component?utm_source=hashnode&utm_medium=feed)

phoenix의 component를 작성하다보면 for, if 문을 사용하는 경우가 많은데 tag 뒤에 :for, :if 를 사용해서 간단하게 줄일 수 있다. tailwind css를 사용한 class도 경우에 따라 추가적인 class를 주고 싶을 때가 있는데 core\_component.ex를 살펴보다 class에 list를 줄 수 있다는 것, 그리고 list 내부에 false인 경우 무시된다는 것을 알게 되었다. 위에서 말한 두가지 요소를 합...

Apr 19, 2023 · 1 min read · clue.hashnode.dev  
Read the article

-   [#elixir](https://hashnode.com/tag/elixir)
-   [#phoenix](https://hashnode.com/tag/phoenix)

## Written by

[Suhku Huh](https://hashnode.com/@clue)

@clue

  
[View profile](https://hashnode.com/@clue)

hobbyist programmer interested in scala, functional programming

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
