Skip to content

Allow custom positioning of buttonHeader in BBBAccordion #33

@Arthurk12

Description

@Arthurk12

Is your feature request related to a problem? Please describe.
When injecting a buttonHeader into BBBAccordion, it is always positioned to the left, next to the title. There is no way to align it to the right side of the header, which is a very common UI pattern — especially for secondary actions like edit, delete, or expand.

Describe the solution you'd like
Add a prop to BBBAccordion (e.g. buttonHeaderPosition or headerButtonAlign) that allows the consumer to define the alignment of the buttonHeader, supporting at least 'left' and 'right' values.

Describe alternatives you've considered
Inject the button via a separate slot/prop already positioned on the right (e.g. headerAction). This avoids the alignment prop but may create confusion about the difference between buttonHeader and headerAction.

Affected component(s)
BBBAccordion

Proposed API / Usage Example

// Button aligned to the right (new behavior)
<BBBAccordion
  title="Settings section"
  buttonHeader={<BBBButton size="sm" icon={<EditIcon />} />}
  buttonHeaderPosition="right"
>
  <AccordionContent />
</BBBAccordion>

// Current behavior (left) remains the default
<BBBAccordion
  title="Section"
  buttonHeader={<BBBButton size="sm">Action</BBBButton>}
>
  <Content />
</BBBAccordion>

Additional context
The default value of buttonHeaderPosition should be 'left' to maintain backward compatibility with existing usages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions