Aligning text and a tikZ picture vertically

Here is my current slide:

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage{tikz}
\usetikzlibrary{backgrounds}

\begin{document}

\begin{frame}
\frametitle{My slide}

\begin{tikzpicture}[framed, background rectangle/.style={thick, draw=black, top color=blue!50, rounded corners}]
\node (step1) at (0, 0) {step 1};
\node (step2) at (0, -3) {step 2};
\end{tikzpicture}
\end{frame}

\end{document}


I would like to write something right next to "step 1" and something else right next to "step 2". I would like to write these two things out of the blue frame. Can you help me?

-

You can also use pgfonlayer available from backgrounds library. Load positioning library and you can do something like the one below.

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage{tikz}
\usetikzlibrary{backgrounds,positioning,fit}

\begin{document}

\begin{frame}
\frametitle{My slide}

\begin{tikzpicture}
\node (step1) at (0, 0) {step 1};
\node (step2) at (0, -3) {step 2};
\begin{pgfonlayer}{background}
\node [fit = (step1) (step2),framed, thick, draw=black, top color=blue!50, rounded corners] {};
\end{pgfonlayer}
\node [right=0.2cm of step1, anchor = west] {Text beside step1};
\node [right=0.2cm of step2, anchor = west] {Text beside step2};
\end{tikzpicture}
\end{frame}

\end{document}

-
Great, thanks ! –  user7064 Feb 21 at 7:13
@user7064 Don't forget to upvote this answer... –  Paul Gaborit Feb 21 at 7:19

Via fit library, you can draw a frame around step1 and step2. Then, you can use base anchors to align some text:

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage{tikz}
\usetikzlibrary{fit,backgrounds}

\begin{document}

\begin{frame}
\frametitle{My slide}

\begin{tikzpicture}
\node (step1) at (0, 0) {step 1};
\node (step2) at (0, -3) {step 2};

\begin{scope}[on background layer]
\node[fit=(step1)(step2),thick,draw=black,top
color=blue!50,rounded corners] (frame set){};
\end{scope}

\node[anchor=base west] at (frame set.east |- step1.base)
{something right next to step1};

\node[anchor=base west] at (frame set.east |- step2.base)
{something right next to step2};

\end{tikzpicture}
\end{frame}

\end{document}

-
Thank you very much ! Unfortunately, I cannot accept more than one answer :-( –  user7064 Feb 21 at 7:14
@user7064 Don't forget to upvote each answer... and to accept the better solution from your point of view. ;-) –  Paul Gaborit Feb 21 at 7:18
That's what I did :-) –  user7064 Feb 21 at 7:22

One solution would be to simply add the text to the node and use \rlap so that does not effect the bounding box:

Code:

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage{tikz}
\usetikzlibrary{backgrounds}

\begin{document}

\begin{frame}
\frametitle{My slide}

\begin{tikzpicture}[framed, background rectangle/.style={thick, draw=black, top color=blue!50, rounded corners}]
\node (step1) at (0,  0) {step 1 \rlap{\hspace*{0.5cm} Details of Step 1}};
\node (step2) at (0, -3) {step 2 \rlap{\hspace*{0.5cm} Details of Step 2}};
\end{tikzpicture}
\end{frame}

\end{document}

-
Thank you very much ! Unfortunately, I cannot accept both :-( –  user7064 Feb 21 at 7:12