I couldn't find a way to make the tcolorbox adjust automatically with the tikzpictures inside or the title (if it's wider). I also want them to appear on the same line.
Here's my MWE
\documentclass[a4paper,11pt]{article}
\usepackage[french]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage{tcolorbox}
\begin{document}
\newtcolorbox{blueboxb}[1]{hbox,center title, colback=pink!20,
colframe=blue!20,fonttitle=\bfseries,title={#1}}
\newtcolorbox{blueboxs}[1]{hbox,center title, colback=pink!20,
colframe=blue!20,fonttitle=\bfseries,title={#1}}
\newtcolorbox{orangebox}[1]{colback=pink!20,colframe=orange!40,fonttitle=\bfseries,
title={#1}}
\begin{blueboxb}{\color{black}{Droites parallèles}}
\begin{tikzpicture}[scale=0.5]
%1
\begin{scope}
\draw (0,0) -- (5,0) -- (7,3) -- (2,3) -- cycle;
\draw[green!50!blue] (2,1) -- (4.5,2.5) node [right] {$\Delta$};
\draw[red!80,xshift=0.5cm,yshift=-0.5cm] (2,1) -- (4.5,2.5) node [right]
{$\Delta^{\prime}$};
\end{scope}
%2
\begin{scope}[xshift=8cm]
\draw (0,0) -- (5,0) -- (7,3) -- (2,3) -- cycle;
\draw[red!80] (2,2.5) -- (5.5,1.5);
\draw[green!50!blue,dashed,thick] (2,2.5) -- (5.5,1.5) node [midway,above right]
{$\Delta=\Delta^{\prime}$};
\end{scope}
\end{tikzpicture}
\end{blueboxb}
\begin{blueboxs}{\color{black}{Droites Confondues}}
\begin{tikzpicture}[scale=0.5]
\draw (0,0) -- (5,0) -- (7,3) -- (2,3) -- cycle;
\draw[red!80] (2,2.5) -- (4.5,1) node [right] {$\Delta$};
\draw[green!50!blue] (2,1) -- (4.5,2.5) node [right] {$\Delta^{\prime}$};
\end{tikzpicture}
\end{blueboxs}
\begin{orangebox}{\color{black}{Droites Confondues}}
\begin{tikzpicture}[scale=0.5]
\draw (0,0) -- (5,0) -- (7,3) -- (2,3) -- cycle;
\draw[thick,red!80] (2.5,4.5) node[black,right] {$\Delta^{\prime}$} -- (5,-0.5);
\fill[pink!20] (4,0.1) rectangle (4.9,2);
\draw[red!80,dashed] (2.5,4.5) -- (5,-0.5);
\draw[green!50!blue] (0.5,0.4) node [right,black] {$\Delta$} -- (3,2.5);
\end{tikzpicture}
\end{orangebox}
\end{document}
Thank you!


tikzpicturesyou can use atikz upperoption and save declaringbegin{tikzpicture}...\end{tikzpicture}into every box. And if you addcoltitle=blackyou can avoid fixing the title color for all of them. – Ignasi Mar 16 '22 at 09:17