We present the sliding basis computational framework to automatically synthesize heterogeneous (graded or discrete) material fields for parts designed using constrained optimization. Our framework uses the fact that any spatially varying material field over a given domain may be parameterized as a weighted sum of the Laplacian eigenfunctions enabling efficient design space exploration with the weights as a small set of design variables. We further improve computational efficiency by using the property that the Laplacian eigenfunctions form a spectrum and may be ordered from lower to higher frequencies. This approach allows greater localized control of the material distribution as the sliding window moves through higher frequencies. The approach also reduces the number of optimization variables per iteration, thus the design optimization process speeds up independent of the domain resolution without sacrificing analysis quality. Our method is most beneficial when the gradients may not be computed easily (i.e., optimization problems coupled with external black-box analysis) thereby enabling optimization of otherwise intractable design problems. The sliding basis framework is independent of any particular physics analysis, objective and constraints, providing a versatile and powerful design optimization tool for various applications. We demonstrate our approach on graded solid rocket fuel design and multi-material topology optimization applications and evaluate its performance.