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