This example shows how to programmatically control the AppBar and its commands.

The three buttons below are disabled or enabled when the AppBar is shown or hidden. To detect changes in the AppBar state, listen for the AppBar's beforeshow, aftershow, beforehide, or afterhide events.

The Show Bar button uses the show method to invoke the AppBar.

The Show Commands and Hide Commands buttons use the showCommands and hideCommands methods to control the visibility of commands.

This AppBar is set to sticky and is not dismissed when the user interacts with the application. If you need an AppBar to remain visible while the user interacts with their content (such as selecting multiple items), set the sticky property to true.