Grains.js introduces g-class directive for smooth UI transitions in HTMLg-class directive allows switching classes dynamically based on stateExample of using g-class directive to build a notification box with visibility toggle, error/success styles, and shake animationg-class directive makes conditional styling effortless, enabling delightful UI transitions in plain HTML