The rapid detection of biological and chemical substances in real time is particularly important for public health and environmental monitoring and in the military sector. If the process of substance detection to visual reporting can be implemented into a single miniaturized sensor, there could be a profound impact on practical applications. Here, we propose a compact sensor platform that integrates liquid crystals (LCs) and holographic metasurfaces to autonomously sense the existence of a volatile gas and provide an immediate visual holographic alarm. By combining the advantage of the rapid responses to gases realized by LCs with the compactness of holographic metasurfaces, we develop ultracompact gas sensors without additional complex instruments or machinery to report the visual information of gas detection. To prove the applicability of the compact sensors, we demonstrate a metasurface-integrated gas sensor on safety goggles via a one-step nanocasting process that is attachable to flat, curved, and flexible surfaces.