I want to create a custom tcolorbox that has an icon in the top left corner. For the sake of simplicity I will use some tikzpicture to illustrate what I mean. But reading the tcolorbox manual I can't find a way to make the text in the box wrap the figure. The only way of fitting the figure into the box is by indenting the whole box content via "leftupper=[length]".
\documentclass[12pt]{article}
\usepackage{tikz}
\usepackage[most]{tcolorbox}
\tcbuselibrary{skins}
%%% My custom box
\newtcolorbox{mybox}{%
breakable,
fonttitle=\bfseries,
colback=red!5!white,
enhanced jigsaw,
colframe=red!50!black,
colbacktitle=red!50!black,
colframe=red!50!black,
opacityback=0.35,
leftupper=16mm,
title=test}
%%% The command for the image
\newcommand{\test}{\begin{tikzpicture}
\path[use as bounding box] (-.1,1.6) rectangle +(0.3,.3);
\draw[fill=black] (0,0) circle (.5cm);
\end{tikzpicture}}
\begin{document}
\test
\begin{mybox}This is some random text. This is some random text. This is some random text. This is some random text. This is some random text. This is some random text. This is some random text. This is some random text. This is some random text. This is some random text. This is some random text. This is some random text. This is some random text. This is some random text. This is some random text. This is some random text.
\end{mybox}
\end{document}


wrapfig, you can test with the same code withouttcolorboxand the figure is placed lower than first line. – Ignasi Sep 11 '20 at 06:45\begin{wrapfigure}[10]{L}{5cm}\centering\vspace{-1em}\includegraphics[width=1\linewidth,valign=t]{example-image}\end{wrapfigure}seems to work. – Ignasi Sep 11 '20 at 06:52