Skip to content

chore: Add Code Connect for Section Components - #1249

Draft
amandaye0h wants to merge 5 commits into
mainfrom
code-connect/section-components
Draft

chore: Add Code Connect for Section Components#1249
amandaye0h wants to merge 5 commits into
mainfrom
code-connect/section-components

Conversation

@amandaye0h

@amandaye0h amandaye0h commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Description

Adds Figma Code Connect mappings for React Native section layout components.

SectionHeader.figma.tsx

New SectionHeader.figma.tsx for React Native

Matched props

  • titletitle
  • startAccessorystartAccessory (nested Icon via figma.children())
  • titleAccessorytitleAccessory (nested Icon via figma.children())
  • endAccessoryendAccessory (nested Icon via figma.children())
  • subtitlechildren (nested subtitle content via figma.children('children') when the Figma subtitle boolean is enabled)

Intentionally omits Figma-only properties: variant (Figma only)

SectionDivider.figma.tsx

New SectionDivider.figma.tsx for React Native

Matched props

  • None — example uses <SectionDivider /> with component defaults (marginVertical={5}, borderWidth={1}, borderColor={BorderMuted})

Intentionally omits Figma-only properties: withMargin (Figma only)

Related issues

Manual testing steps

  1. Open MMDS SectionHeader and MMDS SectionDivider in Figma Dev Mode
  2. Select React Native in the platform dropdown
  3. Verify code snippets reflect mapped props (including children when subtitle is enabled) and omit Figma-only properties

Screenshots/Recordings

Before

N/A

After

section-header.mov
section-divider.mov

Pre-merge author checklist

  • I've followed MetaMask Contributor Docs
  • I've completed the PR template to the best of my ability
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@github-actions

Copy link
Copy Markdown
Contributor

📖 Storybook Preview

@amandaye0h amandaye0h changed the title Code connect/section components chore: Add Code Connect for Section Components Jun 19, 2026
@amandaye0h
amandaye0h marked this pull request as ready for review June 19, 2026 11:10
@amandaye0h
amandaye0h requested a review from a team as a code owner June 19, 2026 11:10
SectionHeader,
'https://www.figma.com/design/1D6tnzXqWgnUC3spaAOELN/%F0%9F%A6%8A-MMDS-Components?node-id=9624-8419',
{
props: {

@amandaye0h amandaye0h Jun 22, 2026

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.

I've intentionally omitted isInteractive in Figma and here because it's harder to capture dynamically in Figma.

@amandaye0h
amandaye0h marked this pull request as draft June 24, 2026 09:27
@amandaye0h

Copy link
Copy Markdown
Contributor Author

Reverting to draft to accommodate #1267

@georgewrmarshall georgewrmarshall left a comment

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.

LGTM! Both files are correct and the layer name matching for figma.children() is verified against the Figma component structure. Two follow-up items noted below.

One for the Figma component itself: the tag variant has a flex/alignment issue where the title text renders center-aligned rather than left-aligned — visible in the component playground. Worth a design fix in the Figma file separately from this PR.

title: figma.string('title'),
startAccessory: figma.boolean('startAccessory', {
true: figma.children('startAccessory'),
false: undefined,

@georgewrmarshall georgewrmarshall Jun 24, 2026

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.

suggestion: The Figma docs now distinguish figma.slot() from figma.children(). figma.slot() is designed for freeform content areas (any child type — icon, tag, avatar, etc.) while figma.children() targets named component instances specifically. Since startAccessory, titleAccessory, and endAccessory are freeform slots, migrating to figma.slot() would be more accurate and should improve how nested components like AvatarFavicon resolve in Dev Mode.

Example:

props: {
  title: figma.string('title'),
  startAccessory: figma.slot('startAccessory'),
  titleAccessory: figma.slot('titleAccessory'),
  endAccessory: figma.slot('endAccessory'),
},

@github-actions

Copy link
Copy Markdown
Contributor

📖 Storybook Preview

@github-actions

Copy link
Copy Markdown
Contributor

📖 Storybook Links

Compare the preview for this pull request with the latest Storybooks from the main branch.

🔀 Pull Request Preview

🌳 Main Branch (Latest)

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