Tracking Components
The tracking process translates sets of files into a single component that is semantically understood by Bit. It is the first step in a component's journey to complete independency.
When a component gets tracked, Bit does the following:
- It determines which files should be be included in that component (see the result in the .bitmap file)
- It determines the component ID
- It determines the component entry point and its dependency graph
- It creates a package in the workspace
node_modulesdirectory - It renders the component in the Workspace UI
Using Bit Create#
Tracking components is done automatically if you are using bit create to create your components.
- TypeScript
- JSX
bit create react-component ui/cardbit create react-component-js ui/cardis the same as
- TypeScript
- JSX
bit create react-component card --namespace uibit create react-component-js card --namespace uiThe following message will appear in the terminal and your component will be created at the location specified and using the env that has been set in your workspace.jsonc.
the following 1 component(s) were created
my-scope/ui/card location: my-scope/ui/card env: teambit.react/reacttip
Use bit create --help or bit create -h to get a list of available options for this command.
To see a list of component templates available:
bit templatesIf you would like to create your own component template generator then check out our guide in Extending Bit
Pre-existing Components#
Components not created with the bit-create command will need to be manually added to the workspace using the bit-add command.
Track a single component#
bit add ui/button --namespace uiNamespaces also support nesting.
bit add ui/base/button --namespace ui/baseNamespaces#
Namespaces serve as folders that organize components in the Workspace or inside a scope on bit.dev. You can use namespaces inside a scope to group related components.
To namespace a component use the --namespace or -n option.
Specifying a namespace helps you organize your components and lets you perform actions on multiple components at once. Namespaces are also useful in specifying overriding rules for all components under a specific namespace.
A tracked component should appear in the Workspace UI navigation bar with an "N" to its right, to signify that it is a new component.

Check for tracking issues
Use the bit status command to check for tracking issues.
Track multiple components#
To track multiple components, set the path to the common directory and use the * wildcard.
For example:
bit add path/to/common/path/*Set an entry point for a component#
The default entry point is index.ts/index.js. To set a different entry point:
bit add <path to component> --main <entry file>For example
bit add components/ui/button --main main.jsUntracking components#
bit untrack <component id>Best Practices#
- Start tracking components bottom-up, so all components that are shared by other components are tracked first.
- Plan and arrange components in namespaces according to their functionality, similar to the way you would arrange them in folders in a project.
- Review the package.json in your original projects to ensure proper definition of dependencies.
- If you are using path aliases in your
importstatements, make sure you define Bit's custom paths resolution configuration.