% !TeX root = tcolorbox.tex
% include file of tcolorbox.tex (manual of the LaTeX package tcolorbox)
\clearpage
\section{Beamer Support}\label{sec:beamer}%
\tcbset{external/prefix=external/beamer_}%
The \mylib{skins} library adds some supporting options for the \refPkg{beamer}
package \cite{tantau:beamer}.
For the following options, the \mylib{skins} library has to be loaded
by a package option or inside the preamble by:
\begin{dispListing}
\tcbuselibrary{skins}
\end{dispListing}

See \zvref{sec:skins} for the documentation of all other options of the \mylib{skins} library.

\begin{docTcbKey}[][doc new and updated={2015-01-09}{2019-03-01}]{only}{=\pbarg{overlay specification}\marg{options}}{style, no default, initially unset}
Sets the given |tcolorbox| \meta{options} in dependency of
a |beamer| \meta{overlay specification}.
Note that this needs the |beamer| class \cite{tantau:beamer}.
The \meta{options} will only be used on the specified |beamer| frames.


\begin{fulldocumentlisting}{}
\documentclass{beamer}
\usepackage[many]{tcolorbox}
\begin{document}

\begin{frame}
  \begin{tcolorbox}[title=My title,fonttitle=\bfseries,
      enhanced,colframe=red!50!black,colback=red!10,colbacktitle=red,
      sidebyside,righthand width=3cm,
      lowerbox=invisible,lower separated=false,
      drop lifted shadow,
      only=<1>{colbacktitle=yellow,coltitle=red!50!black,colframe=red},
      only=<3>{colback=yellow!50,watermark text={Attention!}},
      only=<3->{lowerbox=visible}  ]
    This is a test.
    \begin{itemize}[<+->]
      \item One
      \item Two
      \item \alert<3>{Three}
      \item Four
    \end{itemize}
  \tcblower
    \begin{equation*}
    \int\limits_{1}^{x} \frac{1}{t}~dt = \ln(x).
    \end{equation*}
  \end{tcolorbox}
\end{frame}
\end{document}
\end{fulldocumentlisting}


\begin{fulldocumentlisting}{}
\documentclass{beamer}
\usepackage[most]{tcolorbox}
\begin{document}

\begin{frame}[fragile]
  \begin{tcblisting}{beamer,colback=blue!5,colframe=blue!20!gray,coltitle=yellow,
    title=Example,
    only=<1>{lowerbox=invisible},only=<2>{}
  }
This is an \textbf{example listing}
  \end{tcblisting}
\end{frame}
\end{document}
\end{fulldocumentlisting}

\begin{marker}
The option \refKey{/tcb/only} belonged to the core package before version 4.20.
\end{marker}
\end{docTcbKey}

\clearpage

\begin{docTcbKey}[][doc new={2025-05-28}]{alt}{=\pbarg{overlay specification}\marg{default}\marg{alternative}}{style, no default, initially unset}
Alternates between different |tcolorbox| options in dependency of a |beamer| \meta{overlay specification}.
The \meta{default} options are used on the specified slides, otherwise the \meta{alternative} options.
Note that this needs the |beamer| class \cite{tantau:beamer}.
\end{docTcbKey}

\begin{docTcbKey}[][doc new={2025-07-07}]{set alt}{=\marg{default}\marg{alternative}}{no default, initially \brackets{}\brackets{}}
Stores the arguments later to be used with \refKey{/tcb/use alt}.
\end{docTcbKey}

\begin{docTcbKey}[][doc new={2025-07-07}]{use alt}{=\pbarg{overlay specification}}{style, no default, initially unset}
Like \refKey{/tcb/alt}, but uses the arguments stored with \refKey{/tcb/set alt}.
\end{docTcbKey}

\begin{docTcbKey}[][doc new={2025-05-28}]{temporal}{=\pbarg{overlay specification}\marg{before slide}\marg{default}\marg{after slide}}{style,\linebreak no default, initially unset}
Temporarily changes between different |tcolorbox| options in dependency of a |beamer| \meta{overlay specification}.
The \meta{default} options are used on the specified slides,
the \meta{before slide} options are used before them, and
the \meta{after slide} options after them.
Note that this needs the |beamer| class \cite{tantau:beamer}.
\end{docTcbKey}

\begin{docTcbKey}[][doc new={2025-07-07}]{set temporal}{=\marg{before slide}\marg{default}\marg{after slide}}{no default, initially \brackets{}\brackets{}\brackets{}}
Stores the arguments later to be used with \refKey{/tcb/use temporal}.
\end{docTcbKey}

\begin{docTcbKey}[][doc new={2025-07-07}]{use temporal}{=\pbarg{overlay specification}}{style, no default, initially unset}
Like \refKey{/tcb/temporal}, but uses the arguments stored with \refKey{/tcb/set temporal}.
\end{docTcbKey}


\begin{docTcbKey}[][doc new={2019-03-01}]{hide}{=\pbarg{overlay specification}}{style, no default, initially unset}
Sets the \refKey{/tcb/beamer hidden} style in dependency of
a |beamer| \meta{overlay specification}.
\refKey{/tcb/beamer hidden} can be redefined for customization.
\end{docTcbKey}

\begin{docTcbKey}[][doc new={2019-03-01}]{beamer hidden}{}{style, no options, initially |nirvana|}
This style is not intended to be used directly, but in concealed way by applying
\refKey{/tcb/hide}. The style can be redefined.
\begin{dispListing}
\tcbset{
  beamer hidden/.style={invisible,interior hidden,colframe=blue!20!gray!15},
}
\end{dispListing}
\end{docTcbKey}

\begin{docTcbKey}[][doc new={2019-03-01}]{alert}{=\pbarg{overlay specification}}{style, no default, initially unset}
Sets the \refKey{/tcb/beamer alerted} style in dependency of
a |beamer| \meta{overlay specification}.
\refKey{/tcb/beamer alerted} can be redefined for customization.
\end{docTcbKey}


\begin{docTcbKey}[][doc new={2019-03-01}]{beamer alerted}{}{style, no options, initially |fuzzy halo|}
This style is not intended to be used directly, but in concealed way by applying
\refKey{/tcb/alert}. The style can be redefined.
\begin{dispListing}
\tcbset{
  beamer alerted/.style={colframe=red!50!gray},
}
\end{dispListing}
\end{docTcbKey}


\clearpage

The following examples use \refEnv{tcbitemize} from \mylib{raster} for
convenient use of a list of boxes which are uncovered one by one.


\begin{fulldocumentlisting}{run pdflatex}
\documentclass{beamer}
\usepackage[most]{tcolorbox}
\begin{document}

\begin{frame}
  \begin{tcbitemize}[raster equal height=rows,
    enhanced,colback=blue!5,colframe=blue!20!gray,coltitle=yellow,
    ]
  \tcbitem[title=One,alert=<1>]
    First Statement
  \tcbitem[title=Two,hide=<-1>,alert=<2>]
    Second Statement
  \tcbitem[title=Three,hide=<-2>,alert=<3>]
    Test
  \tcbitem[title=Four,hide=<-3>,alert=<4>]
    \begin{equation*}
    \int\limits_{1}^{x} \frac{1}{t}~dt = \ln(x).
    \end{equation*}
  \tcbitem[title=Five,hide=<-4>,alert=<5>]
    \includegraphics[width=1cm]{goldshade.png}
  \tcbitem[title=Six,hide=<-5>,alert=<6>]
    Test
  \end{tcbitemize}
\end{frame}
\end{document}
\end{fulldocumentlisting}



\begin{fulldocumentlisting}{run pdflatex}
\documentclass{beamer}
\usepackage[most]{tcolorbox}
\begin{document}

\begin{frame}
  \begin{tcbitemize}[raster equal height=rows,enhanced,
    set temporal={invisible,interior hidden,colframe=blue!20!gray!15}
                 {colback=red!5,colframe=red!50!gray,coltitle=yellow}
                 {colback=blue!5,colframe=blue!20!gray,coltitle=yellow},
    ]
  \tcbitem[title=One,use temporal=<1>]
    First Statement
  \tcbitem[title=Two,use temporal=<2>]
    Second Statement
  \tcbitem[title=Three,use temporal=<3>]
    Test
  \tcbitem[title=Four,use temporal=<4>]
    \begin{equation*}
    \int\limits_{1}^{x} \frac{1}{t}~dt = \ln(x).
    \end{equation*}
  \tcbitem[title=Five,use temporal=<5>]
    \includegraphics[width=1cm]{goldshade.png}
  \tcbitem[title=Six,use temporal=<6>]
    Test
  \end{tcbitemize}
\end{frame}
\end{document}
\end{fulldocumentlisting}



\begin{fulldocumentlisting}{run pdflatex}
\documentclass{beamer}
\usepackage[most]{tcolorbox}
\begin{document}

\begin{frame}
  \begin{tcbitemize}[raster equal height=rows,beamer,
    colback=blue!5,colframe=blue!20!gray,coltitle=yellow,
    set temporal={colback=white,colframe=gray!50,
                    opacityupper=0.2,opacitytitle=0.2}
                 {colframe=red!50!gray,fuzzy halo}
                 {},
    ]
  \tcbitem[title=One,use temporal=<1>]
    First Statement
  \tcbitem[title=Two,use temporal=<2>]
    Second Statement
  \tcbitem[title=Three,use temporal=<3>]
    Test
  \tcbitem[title=Four,use temporal=<4>]
    \begin{equation*}
    \int\limits_{1}^{x} \frac{1}{t}~dt = \ln(x).
    \end{equation*}
  \tcbitem[title=Five,use temporal=<5>]
    \includegraphics[width=1cm]{goldshade.png}
  \tcbitem[title=Six,use temporal=<6>]
    Test
  \end{tcbitemize}
\end{frame}
\end{document}
\end{fulldocumentlisting}


\begin{fulldocumentlisting}{run pdflatex}
\documentclass{beamer}
\usepackage[most]{tcolorbox}

\NewTColorBox{mybox}{ d<> }{enhanced,
  temporal=<#1>{empty,invisible}
               {colback=red!5,colframe=red!20!gray}
               {colframe=blue!20!gray,colback=blue!5},
}
\begin{document}

\begin{frame}
  \begin{mybox}<1>
    First Statement
  \end{mybox}
  \begin{mybox}<2>
    Second Statement
  \end{mybox}
  \begin{mybox}<3>
    Third Statement
  \end{mybox}
  \begin{mybox}<4>
    Final Statement
  \end{mybox}
\end{frame}
\end{document}
\end{fulldocumentlisting}
