Spinons are well-known as the elementary excitations of one-dimensional antiferromagnetic chains, but means to realize spinons in higher dimensions is the subject of intense research. Here, we use resonant x-ray scattering to study the layered trimer iridate Ba4Ir3O10, which shows no magnetic order down to 0.2 K. An emergent one-dimensional spinon continuum is observed that can be well-described by XXZ spin-1/2 chains with magnetic exchange of ∼55 meV and a small Ising-like anisotropy. With 2% isovalent Sr doping, magnetic order appears below TN=130 K along with sharper excitations, indicating that the spinons become more confined in (Ba1−xSrx)4Ir3O10. We propose that the frustrated intra-trimer interactions effectively reduce the system into decoupled spin chains, the subtle balance of which can be easily tipped by perturbations such as chemical doping. Our results put Ba4Ir3O10 between the one-dimensional chain and two-dimensional quantum spin liquid scenarios, illustrating a new way to suppress magnetic order and realize fractional spinons.