Icons are most appropriate for representing simple, recognizable concepts or actions. When choosing icons for your design system, consider the following guidelines:

  1. Where possible use icons to supplement text, rather than replacing it.
  2. Make sure that the meaning of icons is clear when used without accompanying text.
  3. Choose icons that are easy to recognize and accurately depict the concept or action.
  4. Maintain consistency in the use of icons across your product or brand.
  5. Avoid using icons for complex or abstract concepts that may be confusing to some users.
  6. Adhere to predetermined icon sizes to ensure legibility and ease of recognition.
  7. Test the effectiveness of your icons with users to ensure that they are understood and useful in navigating the interface.

Color

To ensure that icons are effective and legible in different color modes, it is recommended to use our functional foreground colors.

Many of our components are designed to automatically set the color of icons to a predetermined color. For example, banners are configured to set the icon to the matching role color by default.

A banner showing a warning icon in orange with the text 'Your password was reset recently.'

Some icons should always be shown in a specific colors when used within a specific context. This helps to effectively convey their intended meaning and provide a consistent user experience. Here are a few examples:

ExampleIconColor variableUsage
infofg.accentImportant information
checkfg.successSuccessful, passing, or positive result
xfg.dangerError, danger, or negative result
alertfg.attentionWarning

Specific use cases

Certain Octicons are designed for specific use cases and their meaning should not be changed. Most icons also have a predefined color variable, those should not be changed unless placed on colorful/dark backgrounds like buttons. In this case the fg.onEmphasis color can be used. Please refer to the table below for icons with specific guidelines.

ExampleIconContextColor variableUsage
git-commitCommitfg.mutedIndividual or groups of commits.
issue-openedIssuefg.successA newly opened issue that needs attention.
issue-closedIssuefg.doneA done/closed issue.
issue-reopenedIssuefg.successA reopened issue.
issue-draftIssuefg.mutedA draft issue.
git-pull-requestPull requestfg.successA new unmerged pull request that needs attention.
git-pull-request-closedPull requestfg.dangerA closed pull request that wasn't merged.
git-pull-request-draftPull requestfg.mutedA draft pull request.
git-mergePull requestfg.doneA merged request.
repoRepositoryfg.mutedA public repository.
repo-lockedRepositoryfg.attentionA private repository. Not to be confused with lock.
mark-githubBrandingfg.defaultSee our GitHub brand guidelines.
logo-githubBrandingfg.defaultSee our GitHub brand guidelines.

States

To display the state of an action, use a stroke and fill icon combination or its opposite version if available. For "off" or "empty" states, use the outline icon.

Predefined pairs

ExampleIconsUsage
/ heart / heart-fillSponsor / Sponsoring
/ star / star-fillStar / Unstar
/ check-circle / x-circle-fillPass / Fail
/ file-directory-open-fill / file-directory-fillDirectory open / Directory closed
/ bell / bell-slashSubscribe / Unsubscribe
/ bookmark / bookmark-slashSave / Unsave
/ eye / eye-closedWatch / Unwatch
/ cloud / cloud-offlineCloud online / Cloud offline

Maintaining consistency by adhering to the predefined pairs is important to avoid inconsistencies, as demonstrated in the following examples

DoA completed 'upload artifacts' block with a check-circle icon and a failed 'upload artifacts' with a x-circle-fill icon.

Stick to predefined icon pairs.

Don’tA completed 'upload artifacts' block with a check-circle icon and a failed 'upload artifacts' with a x icon.

Create your own icon pairs.

DoTwo examples of correct off states for buttons. A 'Save' button with a outline bookmark icon and 'Unsave' button with a bookmark-slash icon. A 'Subscribe' button with a bell icon and 'Unsubscribe' button with a bell-slash icon.

For "off" or "empty" states, use the slash icon.

Don’tTwo examples of wrong off states for buttons. A 'Save' button with a bookmark icon and 'Unsave' button with a bookmark-filled icon. A 'Subscribe' button with a outline bell icon and 'Unsubscribe' button with a filled bell-filled icon.

Don't use filled icons for representing "off" or "empty states".