Skip to content

[Bug]: Specifying --path in the CLI uses wrong import paths for component dependencies #123

@mattiasw

Description

@mattiasw

Prerequisites

  • I have searched existing issues to ensure this bug hasn't been reported already
  • I have tested this with the latest version of the components

Bug description

When using the CLI and specifying --path to install a component with dependencies (like badges or tags) somewhere else than in components/, the imports ignore the specified path. E.g., for badges the dot-icon import looks like this:

import { Dot } from "@/components/foundations/dot-icon";

instead of

import { Dot } from "@/my-specified-path/foundations/dot-icon";

Steps to reproduce

  1. Run npx untitledui@latest add --path components/untitledui badges
  2. Have a look in src/components/untitledui/base/badges/badges.tsx and notice the dot-icon import.

Expected behavior

The import in badges.tsx should be import { Dot } from "@/components/untitledui/foundations/dot-icon";, or possibly import { Dot } from "../../foundations/dot-icon";.

Actual behavior

The import is import { Dot } from "@/components/foundations/dot-icon";.

Code example

npx untitledui@latest add --path components/untitledui badges

Browser

No response

Device type

No response

Component version

No response

Environment details

  • OS: Ubuntu 25.10
  • Node.js version: 22.14.0
  • React version: 19.2.0
  • Next.js version: 16.0.1
  • Tailwind CSS version: 4.1.16

Screenshots/Videos

No response

Console errors

Additional context

No response

Accessibility impact

  • This bug affects keyboard navigation
  • This bug affects screen reader users
  • This bug affects focus management
  • This bug affects color contrast or visual accessibility

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions