Skip to content

feat: add all rn-primitives components to native-ui package#89

Open
adelrodriguez wants to merge 1 commit intomainfrom
02-14-feat_add_all_rn-primitives_components_to_native-ui_package
Open

feat: add all rn-primitives components to native-ui package#89
adelrodriguez wants to merge 1 commit intomainfrom
02-14-feat_add_all_rn-primitives_components_to_native-ui_package

Conversation

@adelrodriguez
Copy link
Collaborator

@adelrodriguez adelrodriguez commented Feb 18, 2026

Greptile Summary

This PR consolidates all rn-primitives components into the native-ui package, adding 20+ new UI components (accordion, alert-dialog, avatar, badge, card, checkbox, context-menu, dialog, dropdown-menu, hover-card, input, label, menubar, popover, progress, radio-group, select, separator, skeleton, switch, tabs, textarea, toggle, toggle-group, tooltip). The implementation removes duplicate components from the mobile app and centralizes them in the shared package.

Key Changes

  • Added dependencies for all @rn-primitives components to package.json
  • Implemented new components with consistent styling patterns using Tailwind classes
  • Created demo file in apps/mobile/src/app/index.tsx showcasing all components
  • Removed large-title-header complex implementation (simplified to basic export)
  • Deleted duplicate component files from mobile app (alert, avatar, toggle)

Issues Found

  • CSS Variable Bugs (already flagged in previous threads): dropdown-menu.tsx and menubar.tsx use wrong Radix CSS variables (--radix-context-menu-* instead of component-specific variables), breaking web animations
  • Props Dropped on Web: NativeOnlyAnimatedView returns only children on web, discarding layout props like style and pointerEvents

Confidence Score: 3/5

  • This PR has copy-paste errors with CSS variables in dropdown-menu and menubar components that will break web animations
  • The PR adds comprehensive UI components from rn-primitives, which is a positive structural change. However, there are confirmed CSS variable bugs in dropdown-menu.tsx and menubar.tsx where context-menu variables are used instead of the correct component-specific variables. These will cause animation issues on web. Additionally, NativeOnlyAnimatedView silently drops props on web, which could lead to unexpected layout issues. Most other components are well-implemented.
  • packages/native-ui/src/components/dropdown-menu.tsx and packages/native-ui/src/components/menubar.tsx need CSS variable fixes before merge

Important Files Changed

Filename Overview
packages/native-ui/package.json Added dependencies for all @rn-primitives components (accordion, alert-dialog, avatar, etc.) and moved some deps to devDependencies/peerDependencies
packages/native-ui/src/components/dropdown-menu.tsx New dropdown menu component with CSS variable issues (uses context-menu variables instead of dropdown-menu variables)
packages/native-ui/src/components/menubar.tsx New menubar component with CSS variable issues (uses context-menu variables instead of menubar variables)
packages/native-ui/src/components/native-only-animated-view.tsx Helper component that drops props on web (returns only children), potentially losing style/layout props
packages/native-ui/src/components/context-menu.tsx New context menu component implementation using correct CSS variables
packages/native-ui/src/components/accordion.tsx New accordion component with proper animations and platform-specific handling
packages/native-ui/src/components/dialog.tsx New dialog component with overlay, animations, and proper close button
packages/native-ui/src/components/select.tsx New select component with proper scroll buttons and overlay

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[native-ui Package] --> B[Primitive Wrappers]
    A --> C[Custom Components]
    
    B --> D[rn-primitives accordion]
    B --> E[rn-primitives alert-dialog]
    B --> F[rn-primitives avatar]
    B --> G[rn-primitives checkbox]
    B --> H[rn-primitives context-menu]
    B --> I[rn-primitives dialog]
    B --> J[rn-primitives dropdown-menu]
    B --> K[rn-primitives menubar]
    B --> L[rn-primitives select]
    B --> M[15+ more primitives]
    
    C --> N[Alert]
    C --> O[Badge]
    C --> P[Card]
    C --> Q[Skeleton]
    
    R[Mobile App] --> |imports| A
    S[Web App] --> |imports| A
    
    A --> T[Platform-Specific Handling]
    T --> U[NativeOnlyAnimatedView]
    T --> V[FullWindowOverlay iOS]
    T --> W[Platform.select CSS]
    
    style J fill:#ff9999
    style K fill:#ff9999
    style U fill:#ffcc99
Loading

Last reviewed commit: 98b7ee3

@adelrodriguez adelrodriguez marked this pull request as ready for review February 18, 2026 05:33
@coderabbitai
Copy link

coderabbitai bot commented Feb 18, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 02-14-feat_add_all_rn-primitives_components_to_native-ui_package

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

39 files reviewed, 5 comments

Edit Code Review Agent Settings | Greptile

className={cn(
"overflow-hidden rounded-md border border-border bg-popover p-1 shadow-lg shadow-black/5",
Platform.select({
web: "animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 fade-in-0 data-[state=closed]:zoom-out-95 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-context-menu-content-transform-origin) z-50 min-w-[8rem]",
Copy link

Choose a reason for hiding this comment

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

Wrong CSS variable for dropdown menu

DropdownMenuSubContent references --radix-context-menu-content-transform-origin, which is the CSS variable for context menus, not dropdown menus. On web, this means the transform origin will not be set (the variable won't be defined by Radix's dropdown menu), so the animation will fall back to the default origin. The correct variable is --radix-dropdown-menu-content-transform-origin.

The same issue appears in DropdownMenuContent on line 128, which also references --radix-context-menu-content-available-height and --radix-context-menu-content-transform-origin.

Suggested change
web: "animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 fade-in-0 data-[state=closed]:zoom-out-95 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-context-menu-content-transform-origin) z-50 min-w-[8rem]",
web: "animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 fade-in-0 data-[state=closed]:zoom-out-95 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-dropdown-menu-content-transform-origin) z-50 min-w-[8rem]",
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/native-ui/src/components/dropdown-menu.tsx
Line: 82

Comment:
**Wrong CSS variable for dropdown menu**

`DropdownMenuSubContent` references `--radix-context-menu-content-transform-origin`, which is the CSS variable for context menus, not dropdown menus. On web, this means the transform origin will not be set (the variable won't be defined by Radix's dropdown menu), so the animation will fall back to the default origin. The correct variable is `--radix-dropdown-menu-content-transform-origin`.

The same issue appears in `DropdownMenuContent` on line 128, which also references `--radix-context-menu-content-available-height` and `--radix-context-menu-content-transform-origin`.

```suggestion
            web: "animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 fade-in-0 data-[state=closed]:zoom-out-95 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-dropdown-menu-content-transform-origin) z-50 min-w-[8rem]",
```

How can I resolve this? If you propose a fix, please make it concise.

"min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-1 shadow-lg shadow-black/5",
Platform.select({
web: cn(
"z-50 max-h-(--radix-context-menu-content-available-height) origin-(--radix-context-menu-content-transform-origin) animate-in cursor-default fade-in-0 zoom-in-95",
Copy link

Choose a reason for hiding this comment

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

Wrong CSS variables (copy-paste from context-menu)

Both --radix-context-menu-content-available-height and --radix-context-menu-content-transform-origin are incorrect here. These should be the dropdown menu equivalents. These variables won't be defined by Radix's DropdownMenu component on web, causing max-height to be unset (potentially overflowing the viewport) and the transform origin to default.

Suggested change
"z-50 max-h-(--radix-context-menu-content-available-height) origin-(--radix-context-menu-content-transform-origin) animate-in cursor-default fade-in-0 zoom-in-95",
"z-50 max-h-(--radix-dropdown-menu-content-available-height) origin-(--radix-dropdown-menu-content-transform-origin) animate-in cursor-default fade-in-0 zoom-in-95",
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/native-ui/src/components/dropdown-menu.tsx
Line: 128

Comment:
**Wrong CSS variables (copy-paste from context-menu)**

Both `--radix-context-menu-content-available-height` and `--radix-context-menu-content-transform-origin` are incorrect here. These should be the dropdown menu equivalents. These variables won't be defined by Radix's `DropdownMenu` component on web, causing `max-height` to be unset (potentially overflowing the viewport) and the transform origin to default.

```suggestion
                      "z-50 max-h-(--radix-dropdown-menu-content-available-height) origin-(--radix-dropdown-menu-content-transform-origin) animate-in cursor-default fade-in-0 zoom-in-95",
```

How can I resolve this? If you propose a fix, please make it concise.

className={cn(
"overflow-hidden rounded-md border border-border bg-popover p-1 shadow-lg shadow-black/5",
Platform.select({
web: "animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 fade-in-0 data-[state=closed]:zoom-out-95 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-context-menu-content-transform-origin) z-50 min-w-[8rem]",
Copy link

Choose a reason for hiding this comment

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

Wrong CSS variable for menubar sub-content

Same copy-paste issue as in dropdown-menu.tsxMenubarSubContent references --radix-context-menu-content-transform-origin instead of --radix-menubar-content-transform-origin. This means the transform-origin animation won't work correctly on web.

Suggested change
web: "animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 fade-in-0 data-[state=closed]:zoom-out-95 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-context-menu-content-transform-origin) z-50 min-w-[8rem]",
web: "animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 fade-in-0 data-[state=closed]:zoom-out-95 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-menubar-content-transform-origin) z-50 min-w-[8rem]",
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/native-ui/src/components/menubar.tsx
Line: 155

Comment:
**Wrong CSS variable for menubar sub-content**

Same copy-paste issue as in `dropdown-menu.tsx``MenubarSubContent` references `--radix-context-menu-content-transform-origin` instead of `--radix-menubar-content-transform-origin`. This means the transform-origin animation won't work correctly on web.

```suggestion
            web: "animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 fade-in-0 data-[state=closed]:zoom-out-95 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-menubar-content-transform-origin) z-50 min-w-[8rem]",
```

How can I resolve this? If you propose a fix, please make it concise.

"min-w-[12rem] overflow-hidden rounded-md border border-border bg-popover p-1 shadow-lg shadow-black/5",
Platform.select({
web: cn(
"z-50 max-h-(--radix-context-menu-content-available-height) origin-(--radix-context-menu-content-transform-origin) animate-in cursor-default fade-in-0 zoom-in-95",
Copy link

Choose a reason for hiding this comment

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

Wrong CSS variables for menubar content

MenubarContent uses --radix-context-menu-content-available-height and --radix-context-menu-content-transform-origin, which are the context menu CSS variables. These should be --radix-menubar-content-available-height and --radix-menubar-content-transform-origin respectively.

Suggested change
"z-50 max-h-(--radix-context-menu-content-available-height) origin-(--radix-context-menu-content-transform-origin) animate-in cursor-default fade-in-0 zoom-in-95",
"z-50 max-h-(--radix-menubar-content-available-height) origin-(--radix-menubar-content-transform-origin) animate-in cursor-default fade-in-0 zoom-in-95",
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/native-ui/src/components/menubar.tsx
Line: 194

Comment:
**Wrong CSS variables for menubar content**

`MenubarContent` uses `--radix-context-menu-content-available-height` and `--radix-context-menu-content-transform-origin`, which are the context menu CSS variables. These should be `--radix-menubar-content-available-height` and `--radix-menubar-content-transform-origin` respectively.

```suggestion
                    "z-50 max-h-(--radix-menubar-content-available-height) origin-(--radix-menubar-content-transform-origin) animate-in cursor-default fade-in-0 zoom-in-95",
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +16 to +18
if (Platform.OS === "web") {
return props.children as React.ReactNode
}
Copy link

Choose a reason for hiding this comment

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

Web branch drops all props except children

When Platform.OS === "web", this returns props.children directly, silently discarding any other props (className, style, pointerEvents, etc.). This is used in MenubarContent with style={StyleSheet.absoluteFill} and pointerEvents="box-none", which would be lost on web.

Consider wrapping children in a View on web when layout-affecting props are present, or at least documenting that callers must not rely on non-animation props being applied on web.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/native-ui/src/components/native-only-animated-view.tsx
Line: 16-18

Comment:
**Web branch drops all props except `children`**

When `Platform.OS === "web"`, this returns `props.children` directly, silently discarding any other props (`className`, `style`, `pointerEvents`, etc.). This is used in `MenubarContent` with `style={StyleSheet.absoluteFill}` and `pointerEvents="box-none"`, which would be lost on web.

Consider wrapping children in a `View` on web when layout-affecting props are present, or at least documenting that callers must not rely on non-animation props being applied on web.

How can I resolve this? If you propose a fix, please make it concise.

@adelrodriguez adelrodriguez force-pushed the 02-14-feat_add_all_rn-primitives_components_to_native-ui_package branch 2 times, most recently from c870d89 to 9949e29 Compare February 19, 2026 03:53
@adelrodriguez adelrodriguez force-pushed the 02-14-feat_add_all_rn-primitives_components_to_native-ui_package branch from 9949e29 to 98b7ee3 Compare February 19, 2026 05:11
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.

1 participant

Comments