\documentclass[a4paper]{ltxdoc}

\usepackage{ocg-p}

\newcommand*{\pkg}[1]{\textsf{#1}}

\title{\pkg{OCG-P} package, example 1}

\begin{document}

\maketitle

\begin{ocg}{First layer}{oc1}{1}
  The first Layer is visible at start.
\end{ocg}

\begin{ocg}{Second layer}{oc2}{0}
  The second layer is not visible at start.
\end{ocg}

\begin{ocg}{Third layer}{oc3}{1}
 The third layer is visible at start.
\end{ocg}

This text is not inside of a layer and always visible.

\end{document}