Class Drawer
Drawer UI element. A drawer is a UI element that slides in from the side of the screen. It can be used to display additional content or to display a menu.
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: solution.dll
Syntax
public class Drawer : VisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle
Constructors
| Name | Description |
|---|---|
| Drawer() | Default constructor. |
Fields
| Name | Description |
|---|---|
| backdropUssClassName | The Drawer backdrop styling class. |
| drawerContainerUssClassName | The Drawer container styling class. |
| drawerUssClassName | The Drawer element styling class. |
| elevationUssClassName | The elevation styling class prefix. |
| ussClassName | The Drawer main styling class. |
| variantUssClassName | The Drawer variant styling class. |
Properties
| Name | Description |
|---|---|
| anchor | |
| backdropFinalOpacity | The opacity of the backdrop when the drawer is open. |
| backdropTransitionEnabled | Enable or disable the transition animation for the backdrop when opening or closing the drawer. |
| contentContainer | The content container of the drawer. |
| distance | The normalized distance of the drawer from the edge of the screen. 0 means the drawer is closed, 1 means the drawer is fully open. |
| elevation | The elevation level of the drawer. |
| hideBackdrop | Show or hide the backdrop of this drawer. |
| hysteresis | The distance threshold to interact with the drawer when swiping. |
| isOpen | Check if the drawer is open. |
| swipeAreaWidth | The size of the swipe area to open the drawer. |
| swipeable | Ability to swipe the drawer to open it or close it. |
| transitionDurationMs | The duration of the transition when opening or closing the drawer in milliseconds. |
| variant | The variant of the drawer. Permanent drawers are always open and cannot be closed. Temporary drawers can be opened and closed. |
Methods
| Name | Description |
|---|---|
| Close() | Close the drawer. |
| Open() | Open the drawer. |
| Toggle() | Toggle the drawer. If it is open, close it. If it is closed, open it. |
Events
| Name | Description |
|---|---|
| closed | Event fired when the drawer is closed. |
| opened | Event fired when the drawer is opened. |