Can we chance widget

Hi I dont know how to chance widget inside a widget like i put a button in my menu widget and when i click that button can i chance to a new widget

you mean by clicking you remove the widget from its parent and create a new one and add it to viewport?

maybe this will help you