Nucleoporins (nups) in the nuclear pore complex (NPC) form a selective barrier that suppresses the diffusion of most macromolecules while enabling rapid transport of nuclear transport receptor (NTR)-bound cargos. Recent studies have shown that the NPC may dilate and constrict, but how altering the NPC diameter affects its selective barrier properties remains unclear. Here, we build DNA nanopores with programmable diameters and nup arrangements to model the constricted and dilated NPCs. We find that Nup62 proteins form a dynamic cross-channel barrier impermeable to hepatitis B virus (HBV) capsids when grafted inside 60-nm-wide nanopores but not in 79-nm pores, where Nup62 cluster locally. Furthermore, importin-β1 substantially changes the dynamics of Nup62 assemblies and facilitates the passage of HBV capsids through the 60-nm NPC mimics containing Nup62 and Nup153. Our study shows that transport channel width is critical to the permeability of nup barriers and underscores NTRs' role in dynamically remodeling nup assemblies and mediating the nuclear entry of viruses.