Hiding Unused Parameters in Custom Component

Are there Menu_Append helpers and other functions that I could use to reproduce how the Rhino 8 components work here, where component inputs and outputs can be hidden if no data is provided, or do I need to implement this from scratch?