general topology – Disconnected subspace

We know that if $X$ is a disconnected topological space and $C$ is a connected component of $X$, then $C$ is closed. Besides, if $X$ is locally connected, then $C$ is open and closed. Now suppose $Ysubset X$ is a disconnected (topological) subspace of $X$. The proof of the above results suggest that each connected component $C$ of $Y$ is closed in $X$ (not only in $Y$), and if $X$ is locally connected, then $C$ is open in $ X$ (not only open in $Y$). Am I right?