In this paper, we propose a compositional approach to construct subspaces consisting entirely of r-uniform states, i.e. states with each reduction to r subsystems being maximally mixed. The approach generates new objects from old ones by combining encoding isometries of pure quantum error correcting codes with entangled multipartite states and subspaces. Such a scheme allows for construction of states in heterogeneous systems, i.e. those having unequal local dimensions. The presented methods can be also used to obtain new pure quantum error correcting codes from certain combinations of old ones. The approach is illustrated with various examples including constructions of 2-, 3-, 4- and 5-uniform subspaces.