# How to add a shadow to a tikz line?

I have the following tikz picture.

\documentclass{standalone}

\usepackage{tikz}
\usepackage{xcolor}

\begin{document}

\begin{tikzpicture}[
arr/.style={->,   blue, very thick},
lbl/.style={draw, blue, very thick},
]
\draw[fill=red, very thin] (-1,-1) rectangle (1,1);

\draw[arr] (-2,0) .. controls (-.75,-.25)  and ( -.25,.75) .. (.5,0); % ARROW
\node[lbl, anchor=north west] at (.5,0) {};                           % RECTANGLE
\end{tikzpicture}

\end{document}


How can I add a shadow under the blue rectangle?

How can I add a shadow that follows the blue arrow?

To add a shadow to a node, you may use the shadows library and its drop shadow option.

To add a shadow to a path, you may define a shadowed style using transform canvas option.

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\tikzset{
arr/.style={->,blue,very thick},
lbl/.style={draw,blue,very thick},
}
\draw[fill=yellow,very thin] (-1,-1) rectangle (1,1);
\draw[arr,shadowed](-2,0) .. controls (-.75,-1) and ( -.25,1) .. (.5,0)
node[lbl,anchor=north west,fill=yellow,drop shadow] {};
\end{tikzpicture}
\end{document}


You can fake it using a little translated version by (0.02,-0.02). Or you can define some commands to make the set up easier.

\documentclass{standalone}

\usepackage{tikz}
\usepackage{xcolor}

\begin{document}

\begin{tikzpicture}[
arr/.style={->,   blue, very thick},
lbl/.style={draw, blue, very thick},
]
\draw[fill=red, very thin] (-1,-1) rectangle (1,1);
\draw[xshift=.02,yshift=-0.02,black,very thick,->] (-1.98,-.02) .. controls (-.75,-.25)  and ( -.25,.75) .. (.52,-0.02); % ARROW SHADOW
\draw[arr] (-2,0) .. controls (-.75,-.25)  and ( -.25,.75) .. (.5,0); % ARROW
\node[lbl, anchor=north west,black] at (.52,-0.02) {}; %RECT SHADOW
\node[lbl, anchor=north west] at (.5,0) {}             % RECTANGLE

\end{tikzpicture}

\end{document}