Thank you for your interest in contributing to Ionicons! 馃帀
This document outlines the guidelines and processes for contributing to this project.
Please read our Contributor Code of Conduct for information on our rules of conduct. By contributing to Ionicons, you agree to abide by its terms.
-
We recommend using nvm (Node Version Manager) to manage Node.js versions:
- For macOS/Linux:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash - For Windows: Use nvm-windows
- Install and use the LTS version:
nvm install --lts && nvm use --lts
Alternatively, you can download the installer for the LTS version of Node.js directly.
- For macOS/Linux:
-
Fork the repository on GitHub
-
Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/ionicons.git cd ionicons -
Add the original repository as an upstream remote:
git remote add upstream https://github.com/ionic-team/ionicons.git
-
Create a new branch from
mainfor your change:git checkout -b your-feature-branch
-
Install dependencies:
npm install
-
Run the initial build:
npm run build
-
If desired, modify the Icon Component
-
Or, modify and preview the site
- Always create a new branch from
mainfor your changes:git checkout main git pull upstream main git checkout -b your-feature-branch
If you're modifying the ion-icon component:
- Navigate to
src/components/directory and open theiconcomponent to modify - Make your changes to the component code
- Test your changes locally with
npm start - Run the full test suite:
npm run test.specfor unit tests andnpm run test.e2efor E2E tests - All PRs that change component behavior must include tests covering the changes
Tests are crucial for maintaining confidence in changes. All PRs that modify component behavior must include tests covering those changes.
To preview component changes during development:
npm startThis starts the dev server with live-reloading. The test landing page displays all available test pages.
Test pages are organized in src/components/icon/test/ with individual folders for each test scenario.
Run Jest tests for component logic:
npm run test.specRun Playwright tests to generate visual regression snapshots and verify component behavior:
npm run test.e2eView the HTML report after tests complete:
npx playwright show-reportImportant
All E2E test navigation URLs must include a trailing slash (e.g., /icon/test/basic/ not /icon/test/basic). The trailing slash ensures proper directory routing, correct timing for script initialization, and consistent page loading across browsers.
To update visual regression snapshots with new baselines:
npm run test.e2e -- --update-snapshotsOr for a specific test:
npm run test.e2e -- src/components/icon/test/basic/icon.e2e.ts --update-snapshotsNote
Updating snapshots locally updates your gitignored screenshot files for local testing. To update the official repository snapshots, run the "Update Reference Screenshots" GitHub action with your development branch selected.
- This project uses Prettier for code formatting
- Run
npm run prettierto format your code before submitting
- Run
npm run buildto build the complete package - Run
npm run build.filesto rebuild only the SVG icon files
Please submit issues for:
- Bug reports
- Feature requests
- General questions about the project
When creating issues:
-
If you have a question about using Ionicons, please ask on the Ionic Forum or in the Ionic Discord.
-
It is required that you clearly describe the steps necessary to reproduce the issue you are running into. Although we would love to help our users as much as possible, diagnosing issues without clear reproduction steps is extremely time-consuming and simply not sustainable.
-
The issue list of this repository is exclusively for bug reports and feature requests. Non-conforming issues will be closed immediately.
-
Check if a similar issue already exists by searching through existing issues. You can search through existing issues to see if there is a similar one reported. Include closed issues as it may have been closed with a solution.
-
Use the provided issue templates and clearly describe:
- Expected behavior
- Actual behavior
- Steps to reproduce (for bugs)
- Browser/device information when relevant
-
Create a new issue that thoroughly explains the problem.
-
Before submitting a Pull Request (PR), please:
- Create an issue first to discuss the proposed changes
- Comment on an existing issue mentioning you'd like to work on it
- Look for issues labeled with
help wantedif you're new to the project
-
Creating the PR:
- Update your fork to the latest upstream main
- Make your changes in a new git branch
- Follow the code style of the project
- Include relevant tests
- Make sure all tests pass:
npm test - Update documentation if needed
- Create a new pull request with the
mainbranch as the base.