This is my code:
\begin{tcolorbox}
this is line 1\\
\hspace*{5mm}this is line 2
\end{tcolorbox}
This is the code's output (red line is where the right side of the box should've been if it were automatically adjustable to the text size):
If I specify [hbox] option, it adjusts automatically but ignores the text's line breaks (which I need to keep).