     public var insertAnimation: NSOutlineView.AnimationOptions? = [.effectFade, .slideUp]
     public var deleteAnimation: NSOutlineView.AnimationOptions? = [.effectFade, .slideUp]
 
+    let isItemExpandable: ((TreeNode, TreeNode.Value?, NSOutlineView) -> Bool)?
     let measureCell: ((TreeNode, TreeNode.Value?, NSOutlineView) -> CGFloat?)?
     let createCell: ((TreeNode, TreeNode.Value?, NSTableColumn?, NSOutlineView) -> NSView?)?
 
     public init() {
         // This initializer allows subclassing without having to declare default initializer in subclass.
+        self.isItemExpandable = nil
         self.measureCell = nil
         self.createCell = nil
     }
 
-    public init(measureCell: ((TreeNode, TreeNode.Value?, NSOutlineView) -> CGFloat?)? = nil, createCell: ((TreeNode, TreeNode.Value?, NSTableColumn?, NSOutlineView) -> NSView?)? = nil) {
+    public init(isItemExpandable: ((TreeNode, TreeNode.Value?, NSOutlineView) -> Bool)? = nil, measureCell: ((TreeNode, TreeNode.Value?, NSOutlineView) -> CGFloat?)? = nil, createCell: ((TreeNode, TreeNode.Value?, NSTableColumn?, NSOutlineView) -> NSView?)? = nil) {
+        self.isItemExpandable = isItemExpandable
         self.measureCell = measureCell
         self.createCell = createCell
+    }
+
+    open func isExpandable(for item: TreeNode.Value?, outlineView: NSOutlineView, dataSource: TreeNode) -> Bool {
+        return self.isItemExpandable?(dataSource, item, outlineView) ?? false
     }
 
     open func height(for item: TreeNode.Value?, outlineView: NSOutlineView, dataSource: TreeNode) -> CGFloat? {

            to: #selector(NSOutlineViewDataSource.outlineView(_:numberOfChildrenOfItem:)),
            map: { (dataSource: Element.UnderlyingCollection?, _: NSOutlineView, item: Element.UnderlyingCollection?) -> Int in
                guard let dataSource = dataSource else { return 0 }
                return item?.children.count ?? dataSource.count // TODO check if this is correct
            }
        )


            property: dataSource,
            to: #selector(NSOutlineViewDataSource.outlineView(_:objectValueFor:byItem:)),
            map: { (_: Element.UnderlyingCollection?, _: NSOutlineView, _: NSTableColumn, item: Element.UnderlyingCollection?) -> Any? in
                return item?.value
            }
        )

