---
title: NSDrawer
framework: appkit
role: symbol
role_heading: Class
path: appkit/nsdrawer
---

# NSDrawer

A user interface element that contains and displays text, scroll, and browser views, in addition to other view subclasses.

## Declaration

```swift
class NSDrawer
```

## Overview

Overview A drawer is associated with a window, called its parent, and can appear only while its parent is visible onscreen. A drawer cannot be moved or ordered independently of a window, but is instead attached to one edge of its parent and moves along with it.

## Topics

### Creating Drawers

- [init(contentSize:preferredEdge:)](appkit/nsdrawer/init(contentsize:preferrededge:).md)
- [delegate](appkit/nsdrawer/delegate.md)

### Opening and Closing Drawers

- [close()](appkit/nsdrawer/close().md)
- [close(_:)](appkit/nsdrawer/close(_:).md)
- [open()](appkit/nsdrawer/open().md)
- [open(_:)](appkit/nsdrawer/open(_:).md)
- [open(on:)](appkit/nsdrawer/open(on:).md)
- [toggle(_:)](appkit/nsdrawer/toggle(_:).md)
- [state](appkit/nsdrawer/state-swift.property.md)

### Managing Drawer Size

- [contentSize](appkit/nsdrawer/contentsize.md)
- [leadingOffset](appkit/nsdrawer/leadingoffset.md)
- [maxContentSize](appkit/nsdrawer/maxcontentsize.md)
- [minContentSize](appkit/nsdrawer/mincontentsize.md)
- [trailingOffset](appkit/nsdrawer/trailingoffset.md)

### Managing Drawer Edges

- [edge](appkit/nsdrawer/edge.md)
- [preferredEdge](appkit/nsdrawer/preferrededge.md)

### Managing Drawer Views

- [contentView](appkit/nsdrawer/contentview.md)
- [parentWindow](appkit/nsdrawer/parentwindow.md)

### Constants

- [NSDrawer.State](appkit/nsdrawer/state-swift.enum.md)

### Notifications

- [didCloseNotification](appkit/nsdrawer/didclosenotification.md)
- [didOpenNotification](appkit/nsdrawer/didopennotification.md)
- [willCloseNotification](appkit/nsdrawer/willclosenotification.md)
- [willOpenNotification](appkit/nsdrawer/willopennotification.md)

## Relationships

### Inherits From

- [NSResponder](appkit/nsresponder.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSAccessibilityElementProtocol](appkit/nsaccessibilityelementprotocol.md)
- [NSAccessibilityProtocol](appkit/nsaccessibilityprotocol.md)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSStandardKeyBindingResponding](appkit/nsstandardkeybindingresponding.md)
- [NSTouchBarProvider](appkit/nstouchbarprovider.md)
- [NSUserActivityRestoring](appkit/nsuseractivityrestoring.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Classes

- [NSOpenGLView](appkit/nsopenglview.md)
- [NSOpenGLContext](appkit/nsopenglcontext.md)
- [NSOpenGLLayer](appkit/nsopengllayer.md)
- [NSOpenGLPixelFormat](appkit/nsopenglpixelformat.md)
- [NSForm](appkit/nsform.md)
- [NSFormCell](appkit/nsformcell.md)
- [NSMenuItemCell](appkit/nsmenuitemcell.md)
