add class on condition in react code example Example: add condition inside a className in reactjs className={`banner ${active ? "active" : ""}`}