From c09ad9a0e9b717013eff6f9cd2321596206661ba Mon Sep 17 00:00:00 2001 From: Harsh Date: Tue, 10 Feb 2026 19:08:02 +0530 Subject: [PATCH] feat(ActionBar): customizable overflow menu label, default to 'More items' --- .../react/src/ActionBar/ActionBar.stories.tsx | 17 +++++++++++++++-- packages/react/src/ActionBar/ActionBar.tsx | 9 ++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/packages/react/src/ActionBar/ActionBar.stories.tsx b/packages/react/src/ActionBar/ActionBar.stories.tsx index 06cb18045dd..28c942425c3 100644 --- a/packages/react/src/ActionBar/ActionBar.stories.tsx +++ b/packages/react/src/ActionBar/ActionBar.stories.tsx @@ -21,8 +21,15 @@ export default meta type Story = StoryObj export const Playground: Story = { - render: ({'aria-labelledby': _, ...args}) => ( - + args: { + overflowLabel: 'More item', + size: 'medium', + flush: false, + gap: 'condensed', + }, + + render: ({'aria-labelledby': _, overflowLabel, ...args}) => ( + @@ -48,11 +55,17 @@ Playground.argTypes = { description: 'Horizontal gap scale between items', table: {defaultValue: {summary: 'condensed'}}, }, + overflowLabel: { + control: {type: 'text'}, + description: 'Accessible label for the overflow menu button', + table: {defaultValue: {summary: 'More items'}}, + }, } Playground.args = { size: 'medium', flush: false, gap: 'condensed', + overflowLabel: 'More items', } export const Default = () => ( diff --git a/packages/react/src/ActionBar/ActionBar.tsx b/packages/react/src/ActionBar/ActionBar.tsx index 4bb9d6e2ec4..88384602e71 100644 --- a/packages/react/src/ActionBar/ActionBar.tsx +++ b/packages/react/src/ActionBar/ActionBar.tsx @@ -103,6 +103,12 @@ export type ActionBarProps = { * @default 'condensed' */ gap?: GapScale + + /** + * Accessible label for the overflow menu button + * @default "More items" + */ + overflowLabel?: string } & A11yProps export type ActionBarIconButtonProps = {disabled?: boolean} & IconButtonProps @@ -297,6 +303,7 @@ export const ActionBar: React.FC> = prop flush = false, className, gap = 'condensed', + overflowLabel } = props // We derive the numeric gap from computed style so layout math stays in sync with CSS @@ -400,7 +407,7 @@ export const ActionBar: React.FC> = prop {menuItemIds.size > 0 && ( - +