[Tex/LaTex] Adding an Image inside tcolorbox

tcolorbox

I have a quick question regarding LaTeX's ability to add a small image inside a tcolorbox. What I am trying to accomplish is an entire line with a red color fill and left aligned white text and an image at the end of the line (The image is a rectangular with identical height as the line. Here is the code which I would like to add an image to.

\begin{tcolorbox}[
      breakable,
      left=0pt,
      right=0pt,
      top=8pt,
      bottom=8pt,
      colback=red,
      colframe=red,
      width=\textwidth, 
      enlarge left by=0mm,
      boxsep=5pt,
      arc=0pt,
      outer arc=0pt,
    ]
    \Large
    \textbf{\textcolor{white}{Left Aligned Text} }
\end{tcolorbox}

Currently when I add an \includegraphics command it ruins the dimensions of the colorbox above.

Thank you for the help.

Best Answer

Based on my comment, I \smashed the \includegraphics and used a \raisebox to center it.

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{tcolorbox}
\begin{document}
\begin{tcolorbox}[
%      breakable,
      left=0pt,
      right=0pt,
      top=8pt,
      bottom=8pt,
      colback=red,
      colframe=red,
      width=\textwidth, 
      enlarge left by=0mm,
      boxsep=5pt,
      arc=0pt,
      outer arc=0pt,
    ]
    \Large
    \textbf{\textcolor{white}{Left Aligned Text}
  \hfill\smash{\raisebox{-11pt}{\includegraphics[width=1cm,height=1cm]{demo}}} 
}
\end{tcolorbox}
\end{document}

enter image description here