Skip to content

Create stat card component - #26852

Merged
maxiadlovskii merged 6 commits into
masterfrom
feat/create-stat-component/issue-26850
Aug 5, 2026
Merged

Create stat card component#26852
maxiadlovskii merged 6 commits into
masterfrom
feat/create-stat-component/issue-26850

Conversation

@maxiadlovskii

@maxiadlovskii maxiadlovskii commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Description

This PR creates stat card component and replace it usage in collectors
Screenshot 2026-07-31 at 13 28 49
The visual difference is that now the label is on the top of the number. That was done to fit sub value option as well

Motivation and Context

fix: #26850

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
/jpd https://github.com/Graylog2/graylog-plugin-enterprise/pull/15070

@maxiadlovskii
maxiadlovskii requested review from linuspahl and thll July 31, 2026 13:04
@kroepke
kroepke self-requested a review August 3, 2026 09:51

@kroepke kroepke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall looks good to me, apart from the one behavior change when a card is not a link.

({ theme, $variant }) => css`
position: relative;
text-align: center;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This text-align made a non-button statcard work, so I believe we need to add it back. Below "Sources" is not a button, because there's no single page we could link to.
Right now text-align: center comes from the Button, but I think we should add it to all StatCard instances. It probably shouldn't live in the AccessibleCard in general.

Image

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.

Nice catch. Thanks!

@maxiadlovskii
maxiadlovskii requested a review from kroepke August 5, 2026 09:08

@kroepke kroepke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nice one, thanks!

@maxiadlovskii
maxiadlovskii merged commit 07df7ec into master Aug 5, 2026
25 checks passed
@maxiadlovskii
maxiadlovskii deleted the feat/create-stat-component/issue-26850 branch August 5, 2026 12:26
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.

Create StatCard component

2 participants