Skip to content

feat: label component#907

Merged
kirillzyusko merged 4 commits into
MetaMask:mainfrom
kirillzyusko:feat/label-component
Feb 20, 2026
Merged

feat: label component#907
kirillzyusko merged 4 commits into
MetaMask:mainfrom
kirillzyusko:feat/label-component

Conversation

@kirillzyusko

@kirillzyusko kirillzyusko commented Feb 16, 2026

Copy link
Copy Markdown
Collaborator

Description

Added Label component aligning it with this repo guidelines.

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/DSYS-276

Manual testing steps

  1. Open StoryBook app
  2. Check Label example

Screenshots/Recordings

Before

After

image

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.

Note

Low Risk
Additive UI component and exports with minimal logic; main risk is minor API surface/packaging or Storybook registration issues.

Overview
Adds a new Label component that wraps Text and defaults to TextVariant.BodyMd, with LabelProps aliased to TextProps.

Exposes Label from the design-system component barrel (components/index.ts), adds a Storybook story (and updates the auto-generated storybook.requires.js), includes basic render tests, and provides component documentation in Label/README.md.

Written by Cursor Bugbot for commit b5f64ee. This will update automatically on new commits. Configure here.

@brianacnguyen brianacnguyen 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.

can you attach a screen recording to the PR?

@kirillzyusko

Copy link
Copy Markdown
Collaborator Author

@brianacnguyen done 🙌

@kirillzyusko kirillzyusko marked this pull request as ready for review February 17, 2026 17:47
@kirillzyusko kirillzyusko requested a review from a team as a code owner February 17, 2026 17:47
Comment thread packages/design-system-react-native/src/components/Label/Label.constants.ts Outdated

@brianacnguyen brianacnguyen 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.

can you remove the default const?

brianacnguyen
brianacnguyen previously approved these changes Feb 19, 2026

@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.

Great work! Approved ✅ left some follow up comments for the polish phase

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.

Can we remove this image in a follow up PR they tend to become out of date


export const Default: Story = {
args: {
children: 'Sample Label Text',

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.

non-blocking: We should ensure that all of our content follows our content guidelines and is sentenced case

const { getByTestId } = render(
<Label testID="label">Sample Label Text</Label>,
);
expect(getByTestId('label')).toBeDefined();

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.

non-blocking: Let's use toBeOnScreen moving forward to align with mobile unit test best practice

Comment on lines +27 to +41
### `variant`

Optional enum to select between typography variants. The Label defaults to `TextVariant.BodyMd`.

| TYPE | REQUIRED | DEFAULT |
| ------------- | -------- | -------------------- |
| `TextVariant` | No | `TextVariant.BodyMd` |

```tsx
import { Label } from '@metamask/design-system-react-native';
import { TextVariant } from '@metamask/design-system-react-native';

<Label variant={TextVariant.BodySm}>Small Label</Label>
<Label>Default Label (BodyMd)</Label>
```

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.

non-blocking: we should think about if it makes sense to document this prop or would we prefer that the labels are keep consistent across the app in terms of font size/weight etc

@kirillzyusko kirillzyusko enabled auto-merge (squash) February 20, 2026 16:47
@kirillzyusko kirillzyusko merged commit af9c705 into MetaMask:main Feb 20, 2026
42 checks passed
georgewrmarshall added a commit that referenced this pull request Feb 20, 2026
## Summary

Reverts the failed Release 20.0.0 (#921) to redo it properly with
complete changelogs and correct yarn.lock.

## Context

Release 20.0.0 was merged to main but the publish workflow failed due to
a yarn.lock issue:
- **Failed workflow:**
https://github.com/MetaMask/metamask-design-system/actions/runs/22198282954
- **Root cause:** yarn.lock not updated when peer dependency changed

After the release was merged, 7 additional PRs were merged to main:
1. Label component (#907)
2. HeaderBase component (#902)
3. Skeleton (#891)
4. Card (#923)
5. BottomSheetFooter (#899)
6. Toast (#892)
7. Input component (#909)

## Why Revert?

To maintain clean version history and proper changelogs:
- Release 20.0.0 was never published to NPM (latest is 19.0.0)
- The 7 PRs merged after are not documented in Release 20.0.0 changelog
- Reverting allows us to create a proper Release 20.0.0 that includes
ALL changes

## Changes

This PR reverts commit `45004196` which:
- Restores package versions to pre-release state (8.1.1, 0.7.0, 0.6.0,
etc.)
- Restores root package.json version from 20.0.0 to 19.0.0
- Removes Release 20.0.0 changelog entries

## Next Steps

After this is merged:
1. Create new `release/20.0.0` branch using standard release process
2. Include all changes (original + 7 PRs) in changelogs
3. **Run `yarn install` to update yarn.lock**
4. Merge new Release 20.0.0 PR
5. Publish workflow will succeed with correct lockfile

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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.

3 participants