Skip to content

Snippets: Update group treatment and add description support#477

Merged
michaeltaranto merged 6 commits intomasterfrom
snippets-grouping-update
Feb 15, 2026
Merged

Snippets: Update group treatment and add description support#477
michaeltaranto merged 6 commits intomasterfrom
snippets-grouping-update

Conversation

@michaeltaranto
Copy link
Contributor

Improve affordance of snippet group by nesting snippets under sticky group headers.
Snippets also now support an optional description property to help users differentiate similar snippets.

Migration

While not a breaking change, this update does change the way snippets are rendered and how groups are treated, so some migration may be desired.

Previously snippets rendered the group and name on the same line.
For example:

[
  {
    "group": "Button",
    "name": "Small",
    "code": "..."
  },
  {
    "group": "Button",
    "name": "Large",
    "code": "..."
  }
]

resulted in:

---------------
Button Small
Button Large
---------------

Groups are now elevated to sticky headers, with snippets nested underneath:

---------------
Button
---------------
Small
Large
---------------

To avoid grouping migrate to use name and description properties instead, and omit group:

 [
   {
-    group: 'Button',
+    name: 'Button',
-    name: 'Small',
+    description: 'Small',
     code: '...',
   },
   {
-    group: 'Button',
+    name: 'Button',
-    name: 'Large',
+    description: 'Large',
     code: '...',
   },
 ]

which results in the same UX as previously.

@michaeltaranto michaeltaranto requested a review from a team as a code owner February 11, 2026 05:30
@changeset-bot
Copy link

changeset-bot bot commented Feb 11, 2026

🦋 Changeset detected

Latest commit: 81100d2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
playroom Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@felixhabib
Copy link
Contributor

I'm still seeing the top margin offset problem in Safari and Firefox as well as Chrome 🤔

Copy link
Contributor

@felixhabib felixhabib left a comment

Choose a reason for hiding this comment

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

Working really solid now with scrolling! Nice improvement! I left a couple more suggestions but happy with where it's at ⭐

@michaeltaranto michaeltaranto merged commit f2b799f into master Feb 15, 2026
8 checks passed
@michaeltaranto michaeltaranto deleted the snippets-grouping-update branch February 15, 2026 21:28
@seek-oss-ci seek-oss-ci mentioned this pull request Feb 15, 2026
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