Heterotypic functional materials with compositional and topographical properties that vary spatiotemporally on the micro- or nanoscale are common in nature. However, fabricating such complex materials in the laboratory remains challenging. Here we describe a method to continuously create microfibres with tunable morphological, structural and chemical features using a microfluidic system consisting of a digital, programmable flow control that mimics the silk-spinning process of spiders. With this method we fabricated hydrogel microfibres coded with varying chemical composition and topography along the fibre, including gas micro-bubbles as well as nanoporous spindle-knots and joints that enabled directional water collection. We also explored the potential use of the coded microfibres for tissue engineering applications by creating multifunctional microfibres with a spatially controlled co-culture of encapsulated cells.