Skip to content

[docs] Add version badges#3978

Merged
m-bert merged 73 commits intomainfrom
@mbert/docs-badges-versions
Feb 23, 2026
Merged

[docs] Add version badges#3978
m-bert merged 73 commits intomainfrom
@mbert/docs-badges-versions

Conversation

@m-bert
Copy link
Contributor

@m-bert m-bert commented Feb 13, 2026

Description

This PR, similarly to #3975, adds badges for versions for the features.

Darkmode

image

Lightmode

image

Test plan

Read docs 🤓

@m-bert m-bert added the Documentation Documentation change/enhancement label Feb 16, 2026
Copy link
Member

@j-piasecki j-piasecki left a comment

Choose a reason for hiding this comment

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

I'm not sold on the styling. I don't think the version badge should be that attention-grabbing.

<PlatformBadge key={platform} platform={platform} />
))}

{version && <VersionBadge version={version} />}
Copy link
Member

Choose a reason for hiding this comment

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

IMO, the version badge should come before the platform ones.

We can also go the Android way and have it always to the right

Image

We may also want to default to showing "3.0" if no version is provided to be consistent. So there's no ambiguity about which version something is available from.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sold on the styling. I don't think the version badge should be that attention-grabbing.

I agree. Android convention looks good, but do we want it as a plain text, or have it in a badge like platform, with with different color (like white badge with black text)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Styles updated in 36b7fe0. I've also removed unused import from FlowChart (been there to steal useColorMode)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So if styling looks good, the question is where do we want to put them. Props like disableReanimated and so on? Or do we wait for something new.

Copy link
Member

Choose a reason for hiding this comment

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

So if styling looks good, the question is where do we want to put them. Props like disableReanimated and so on? Or do we wait for something new.

That's a good question - on one hand, I like the way Android does it, so everything is clearly labeled, but on the other, that's a lot of boxes. It could be ok if we reduce it only to the version instead of Available from ..., but it's not as clean then.

TL;DR: I don't know

@m-bert m-bert marked this pull request as ready for review February 17, 2026 14:20
},

badge: {
borderRadius: 10,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
borderRadius: 10,
borderRadius: 16,

IMO it looks nicer.

const styles = StyleSheet.create({
container: {
display: 'flex',
flexDirection: 'row',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
flexDirection: 'row',
flexDirection: 'row',
flexWrap: 'wrap',

I think it looks nicer this way on narrow screens.
Image

vs

Image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. I also moved it to the left on smaller screens:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@j-piasecki j-piasecki left a comment

Choose a reason for hiding this comment

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

  1. I forgot about it yesterday, but when I was checking it, I was experimenting with reducing the font size for the version badge (I think 12px). I'm fine with both, so I'll leave it up to you.
  2. Can you please merge this after the platform badges?

@m-bert
Copy link
Contributor Author

m-bert commented Feb 19, 2026

Can you please merge this after the platform badges?

Sure, that's my plan

I forgot about it yesterday, but when I was checking it, I was experimenting with reducing the font size for the version badge (I think 12px). I'm fine with both, so I'll leave it up to you.

12px looks way too small (at least when looking from distance):

image

But I guess your point is to reduce it. To be honest, I'd leave that as it is now.

Base automatically changed from @mbert/docs-badges to main February 19, 2026 12:46
Copilot AI review requested due to automatic review settings February 23, 2026 14:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the docs UI to support showing multiple “platform” badges alongside an (optional) “available from version” badge, and migrates existing docs pages to use the new header component.

Changes:

  • Remove an unused React hook import in the flowchart example.
  • Add a new HeaderWithBadges component + CSS module styling (platform badges + optional version badge).
  • Update multiple MDX docs pages to use HeaderWithBadges instead of HeaderWithBadge.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/docs-gesture-handler/src/examples/CallbacksFlowCharts/FlowChart.jsx Removes unused useLayoutEffect import.
packages/docs-gesture-handler/src/components/HeaderWithBadges/index.tsx Introduces new header component rendering platform badges and an optional version badge.
packages/docs-gesture-handler/src/components/HeaderWithBadges/styles.module.css Adds styling for platform badges and theme-aware version badge.
packages/docs-gesture-handler/docs/gestures/use-tap-gesture.mdx Migrates to HeaderWithBadges.
packages/docs-gesture-handler/docs/gestures/use-pan-gesture.mdx Migrates to HeaderWithBadges.
packages/docs-gesture-handler/docs/gestures/use-native-gesture.mdx Migrates to HeaderWithBadges.
packages/docs-gesture-handler/docs/gestures/use-long-press-gesture.mdx Migrates to HeaderWithBadges.
packages/docs-gesture-handler/docs/gestures/use-hover-gesture.mdx Migrates to HeaderWithBadges.
packages/docs-gesture-handler/docs/gestures/use-fling-gesture.mdx Migrates to HeaderWithBadges.
packages/docs-gesture-handler/docs/gestures/_shared/base-gesture-config.mdx Migrates to HeaderWithBadges.
packages/docs-gesture-handler/docs/fundamentals/gesture-detector.mdx Migrates to HeaderWithBadges.
packages/docs-gesture-handler/docs/components/reanimated_swipeable.mdx Migrates to HeaderWithBadges.
packages/docs-gesture-handler/docs/components/reanimated-drawer-layout.mdx Migrates to HeaderWithBadges.
packages/docs-gesture-handler/docs/components/pressable.mdx Migrates to HeaderWithBadges.
packages/docs-gesture-handler/docs/components/buttons.mdx Migrates to HeaderWithBadges.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +78 to +80
{platforms
?.map((platform) => platform.toLowerCase() as Platform)
.sort()
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

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

platforms is a required prop in HeaderWithBadgesProps, but the render uses optional chaining (platforms?.map(...)). This makes the type contract misleading and can hide mistakes at call sites. Either remove the optional chaining (and keep platforms required) or make the prop optional and define an explicit empty-state behavior.

Copilot uses AI. Check for mistakes.
@m-bert m-bert merged commit 554e668 into main Feb 23, 2026
6 checks passed
@m-bert m-bert deleted the @mbert/docs-badges-versions branch February 23, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Documentation change/enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants