Skip to content

[ FEATURE ] Add CLI Option to Generate Namespaced Components #373

@coolRoger

Description

@coolRoger

Is your feature request related to a problem? Please describe.

Currently, when generating a component using npx @react-native-reusables/cli@latest add [component], the generated import statements are always in the named import style. For example:

import { Avatar, AvatarFallback, AvatarImage } from '~/components/ui/avatar';

This results in a more verbose usage pattern. I’d prefer a cleaner, more intuitive API when using the components.

Describe the solution you'd like

I’d like an option in the CLI (e.g., a flag or config setting) to choose the component structure style.
Specifically, it should support default imports like:

import Avatar from '~/components/ui/avatar';

And the component usage would look like:

<Avatar alt="Zach Nugent's Avatar">
  <Avatar.Image source={{ uri: GITHUB_AVATAR_URI }} />
  <Avatar.Fallback>
    <Text>ZN</Text>
  </Avatar.Fallback>
</Avatar>

Describe alternatives you've considered

Manually rewriting imports and component usage after generation (not ideal for DX).

Creating a wrapper component to simulate this structure (adds unnecessary indirection).

Additional context

This approach aligns well with design systems like Radix UI or ShadCN where components follow a namespaced structure and are easier to reason about hierarchically.

Activity

mrzachnugent

mrzachnugent commented on Aug 22, 2025

@mrzachnugent
Member

Hey @coolRoger cool idea but closing this issue as it is not planned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @coolRoger@mrzachnugent

        Issue actions

          [ FEATURE ] Add CLI Option to Generate Namespaced Components · Issue #373 · founded-labs/react-native-reusables