In this paper, we investigate the dynamics of charged compact stars in \(f(\mathcal {R})\) theory of gravity, where f is a function of the Ricci scalar \(\mathcal {R}\) . For this purpose, we investigate the field equations in the presence of charge using \(f(\mathcal {R})\) modified gravity. Moreover, we manipulate the field equations to get a single non-linear differential equation due to complicated nature of equations and employ some numerical techniques to get the desired solutions. We also investigate some physical properties of compact stars including energy density, pressure component, equation of state parameter, energy conditions, and causality conditions respectively. Furthermore, we examine the dynamics of slowly rotating compact stars by using \(f(\mathcal {R}) = \mathcal {R} + \alpha \mathcal {R}^2\) gravity model. For our current analysis, we have chosen six compact stars namely \(PSR1903 + 327\) , \(PSR1937 + 21 \) , \(PSRJ1614 -2230 \) , \(Cen~X-3 \) , \(Vela ~X-1 \) and \(4U1608-52\) . Employing a first-order approximation in angular velocity, we calculate the mass-radius relationship and moment of inertia for these considered compact stars. Additionally, we investigate the relationships between mass and energy density with respect to the radius of the compact star, which exhibits the natural behavior, thereby validating our approach.