Skip to content

Adds bsSize props to Section component and extends options for titleAs - #26899

Open
maxiadlovskii wants to merge 2 commits into
masterfrom
feat/add-bsSize-props-to-Section-component
Open

Adds bsSize props to Section component and extends options for titleAs#26899
maxiadlovskii wants to merge 2 commits into
masterfrom
feat/add-bsSize-props-to-Section-component

Conversation

@maxiadlovskii

@maxiadlovskii maxiadlovskii commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Description

This PR
adds a prop like bsSize and changes padding depending on the prop. It uses the same mapping as we have in buttons.
It also can extens titleAs  to receive h4, h5

Motivation and Context

In the current implementation, we use the paddings theme.spacings.md, and in some cases it makes the container too big.
Check this PR
https://github.com/Graylog2/graylog-plugin-enterprise/pull/15118

We can't restyle it in my place of use because we have this padding for Container and Header depending on whether Section is expanded.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have requested a documentation update.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

/nocl

@maxiadlovskii
maxiadlovskii requested review from a team, dennisoelkers and linuspahl August 5, 2026 14:42
disableCollapseButton?: boolean;
collapseButtonPosition?: 'left' | 'right';
className?: string;
bsSize?: BsSize;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want to support all four variants of "BsSize", or just the two which are currently needed?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we only support two variants we would potentially have less inconsistency in the application longterm.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@linuspahl for now, just 2. But it would be better to use the already existing prop regarding the size, just do not introduce a new one. And as bsSize everywhere else contains four variants it would be better to keep them. I think that will be more consistent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants