This guide covers how to set up and work on Mintlify Components locally.
- Clone the repository:
git clone https://github.com/mintlify/components.git
cd components- Install dependencies:
pnpm install- Set up pre-commit hooks:
pnpm exec husky installBuild the component library:
pnpm buildFor development with watch mode:
pnpm devRun Storybook to develop and preview components:
pnpm storybookThis starts a local server at http://localhost:6006 where you can view and interact with all components.
Build Storybook for production:
pnpm build-storybookCheck code style:
pnpm lint:checkFix linting issues automatically:
pnpm lint:fixWe use Biome for linting and formatting. The pre-commit hooks will run linting automatically before each commit.
packages/
└── components/ # Main component package
├── src/
│ ├── components/ # React components
│ ├── hooks/ # Custom React hooks
│ ├── utils/ # Utility functions
│ └── index.ts # Package entry point
├── .storybook/ # Storybook configuration
└── dist/ # Build output
- Create a new directory under
packages/components/src/components/ - Implement the component with TypeScript
- Export it from
packages/components/src/components/index.ts - Add a Storybook story for documentation
- Run
pnpm buildto verify the build succeeds
- Use TypeScript for all new code
- Follow existing patterns in the codebase
- Components should be compatible with React 18 and 19
- Use Tailwind CSS for styling