Tuneable nanostructured materials such as metal-organic frameworks (MOFs) and metal halide perovskites (MHPs) are highly promising contenders for various pressing technological challenges, from efficient photovoltaic devices to high-performant shock absorbers. Their highly modifiable atomic structure and polymorphism, which can lead to large-amplitude phase transitions in response to small changes in structural composition or external triggers, make them attractive platforms for rational material design. However, to reach their full potential, it is crucial to fundamentally understand the relation between these modifications and the time-dependent macroscopic material response. This proposal will therefore establish general design principles, applicable to both MOFs and MHPs, based on the strain field concept. Strain fields emerge when the material deviates from its equilibrium structure and extend over the whole crystal, relating atomic-level deviations with macroscopic material behaviour. Herein, we will construct a library of computational strain fingerprints for various types of spatial disorder, including crystal surfaces, and assess their impact on the phase stability of these materials. By accounting for the effect of external triggers and the intrinsic timescale for strain field nucleation and propagation, overarching principles to rationally design the structural and time-dependent functional response of strain-engineered 4D MOF and MHP materials will be formulated.