Skip to content

feat(S2): add ActionBar support to TreeView#9695

Merged
reidbarber merged 2 commits intomainfrom
treeview-actionbar
Feb 26, 2026
Merged

feat(S2): add ActionBar support to TreeView#9695
reidbarber merged 2 commits intomainfrom
treeview-actionbar

Conversation

@reidbarber
Copy link
Member

@reidbarber reidbarber commented Feb 24, 2026

Adds ActionBar support to TreeView. Should be similar to TableView.

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

Check new stories and new docs.

🧢 Your Project:

@rspbot
Copy link

rspbot commented Feb 24, 2026

@rspbot
Copy link

rspbot commented Feb 25, 2026

@rspbot
Copy link

rspbot commented Feb 25, 2026

## API Changes

@react-spectrum/s2

/@react-spectrum/s2:TreeView

 TreeView <T extends {}> {
   UNSAFE_className?: UnsafeClassName
   UNSAFE_style?: CSSProperties
   aria-describedby?: string
   aria-details?: string
   aria-label?: string
   aria-labelledby?: string
   autoFocus?: boolean | FocusStrategy
   children?: ReactNode | (T) => ReactNode
   defaultExpandedKeys?: Iterable<Key>
   defaultSelectedKeys?: 'all' | Iterable<Key>
   dependencies?: ReadonlyArray<any>
   disabledBehavior?: DisabledBehavior = 'all'
   disabledKeys?: Iterable<Key>
   disallowEmptySelection?: boolean
   escapeKeyBehavior?: 'clearSelection' | 'none' = 'clearSelection'
   expandedKeys?: Iterable<Key>
   id?: string
   items?: Iterable<T>
   onAction?: (Key) => void
   onExpandedChange?: (Set<Key>) => any
   onSelectionChange?: (Selection) => void
+  renderActionBar?: ('all' | Set<Key>) => ReactElement
   renderEmptyState?: (TreeEmptyStateRenderProps) => ReactNode
   selectedKeys?: 'all' | Iterable<Key>
   selectionMode?: SelectionMode
   shouldSelectOnPressUp?: boolean
   styles?: StylesPropWithHeight
 }

/@react-spectrum/s2:TreeViewProps

 TreeViewProps <T> {
   UNSAFE_className?: UnsafeClassName
   UNSAFE_style?: CSSProperties
   aria-describedby?: string
   aria-details?: string
   aria-label?: string
   aria-labelledby?: string
   autoFocus?: boolean | FocusStrategy
   children?: ReactNode | (T) => ReactNode
   defaultExpandedKeys?: Iterable<Key>
   defaultSelectedKeys?: 'all' | Iterable<Key>
   dependencies?: ReadonlyArray<any>
   disabledBehavior?: DisabledBehavior = 'all'
   disabledKeys?: Iterable<Key>
   disallowEmptySelection?: boolean
   escapeKeyBehavior?: 'clearSelection' | 'none' = 'clearSelection'
   expandedKeys?: Iterable<Key>
   id?: string
   items?: Iterable<T>
   onAction?: (Key) => void
   onExpandedChange?: (Set<Key>) => any
   onSelectionChange?: (Selection) => void
+  renderActionBar?: ('all' | Set<Key>) => ReactElement
   renderEmptyState?: (TreeEmptyStateRenderProps) => ReactNode
   selectedKeys?: 'all' | Iterable<Key>
   selectionMode?: SelectionMode
   shouldSelectOnPressUp?: boolean
   styles?: StylesPropWithHeight
 }

@reidbarber reidbarber enabled auto-merge February 26, 2026 22:20
@reidbarber reidbarber added this pull request to the merge queue Feb 26, 2026
Merged via the queue into main with commit 92902b7 Feb 26, 2026
29 checks passed
@reidbarber reidbarber deleted the treeview-actionbar branch February 26, 2026 22:57
pioug pushed a commit to pioug/react-spectrum that referenced this pull request Feb 28, 2026
…aseline-tracker

* origin/main:
  feat(S2): S2 ListView (adobe#8878)
  refactor: Centralize expandedKeys logic in TreeCollection (adobe#9711)
  chore: Warn if user has interactive elements in their custom Picker value (adobe#9710)
  feat: S2 unavailable menu item (adobe#9657)
  fix: Ensure that opening a submenu via enter/space moves focus to first item in submenu (adobe#9691)
  fix: prevent docs crash by making template elements always append children into .content (adobe#9703)
  docs(RAC): Add TreeSection docs (adobe#9699)
  docs(S2): add Typography search view (adobe#9524)
  docs(S2): fix clipping in Picker custom value AvatarGroup example (adobe#9702)
  fix: patch additional methods so React doesnt break with template elements (adobe#9385)
  tentative fix (adobe#9635)
  docs(S2): fix icon import clipboard content to add underscore for icons starting with number (adobe#9698)
  feat(S2): add ActionBar support to TreeView (adobe#9695)
  fix: combobox interactoutside (adobe#9646)
  fix: skip native Date fast path when local timezone is overridden via setLocalTimeZone (adobe#9678)
  chore: update storybook to 9 (adobe#8634)
  docs: improve custom render value S2 Picker example (adobe#9682)

# Conflicts:
#	yarn.lock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants