The following compiles under cleveref
v0.19
and tcolorbox
v3.80
with TeXLive 2013 under osx 10.6.8 but the reference does not work. I have added an example (commented out) from the doc where the reference does work.
% !TEX TS-program = pdflatexmk
\documentclass{book}
\usepackage{cleveref}
\usepackage{tcolorbox}
%\newtcolorbox[auto counter,number within= chapter, crefname={bluebox}{blueboxes}] {mybluebox}[2][]{colback=blue!5!white,colframe=blue!75!black,fonttitle=\bfseries,title=Bluebox \thetcbcounter: #2,#1}
\newtcolorbox[auto counter,number within=chapter,crefname={example}{examples},Crefname={EXAM}{EXAMS}]{EXAM}[2][]{fonttitle=\small\sffamily,detach title,before upper={\tcbtitle\quad},fontupper=\small\sffamily,coltitle=black,colback=white, colframe=white,title={\textbf{E\footnotesize{XAM} \small{\thetcbcounter}: #2,#1}}}
\begin{document}
\chapter{One}
%\begin{mybluebox}[label={myreference}]{My title}
%This is an example
%\end{mybluebox}
%\Cref{myreference} on \cpageref{myreference}
\begin{EXAM}[label={zap}]{Some Title}
This is my own box.
\end{EXAM}
\Cref{zap} on \cpageref{zap}
\end{document}
,
for the title argument. The title ends at#2
, after that the optional argument#1
comes into action