  Let $F$ be a graph and $\SPEX (n, F)$ be the class of $n$-vertex graphs which
attain the maximum spectral radius and contain no $F$ as a subgraph. Let $\EX
(n, F)$ be the family of $n$-vertex graphs which contain maximum number of
edges and no $F$ as a subgraph. It is a fundamental problem in spectral
extremal graph theory to characterize all graphs $F$ such that $\SPEX (n,
F)\subseteq \EX (n, F)$ when $n$ is sufficiently large. Establishing the
conjecture of Cioab\u{a}, Desai and Tait [European J. Combin., 2022], Wang,
Kang, and Xue [J. Combin. Theory Ser. B, 2023] prove that: for any graph $F$
such that the graphs in $\EX (n, F)$ are Tur\'{a}n graphs plus $O(1)$ edges,
$\SPEX (n, F)\subseteq \EX (n, F)$ for sufficiently large $n$. In this paper,
we prove that $\SPEX (n, F)\subseteq \EX (n, F)$ for sufficiently large $n$,
where $F$ is an $n$-vertex graph with no isolated vertices and $\Delta (F) \leq
\sqrt{n}/40$. We also prove a signless Laplacian spectral radius version of the
above theorem. These results give new contribution to the open problem
mentioned above, and can be seen as spectral analogs of a theorem of Alon and
Yuster [J. Combin. Theory Ser. B, 2013]. Furthermore, as immediate corollaries,
we have tight spectral conditions for the existence of several classes of
special graphs, including clique-factors, $k$-th power of Hamilton cycles and
$k$-factors in graphs. The first special class of graphs gives a positive
answer to a problem of Feng, and the second one extends a previous result of
Yan et al.
