React · @dev.icons/react

Github React icon component

GitHub is a cloud-based platform for hosting, reviewing, and collaborating on Git repositories.

Github logo

Install

npm install @dev.icons/react

Import

import { GithubIcon } from "@dev.icons/react";

Render

<GithubIcon size={32} />

Props

<GithubIcon /> renders an inline <svg>. It accepts every SVG attribute plus these props:

Prop Type Default What it does
sizenumber | string"1em"Sets width and height, so the icon scales with the surrounding text by default.
colorstring"currentColor"Fill for monochrome icons. Color icons keep their brand colors.
altstringnoneAccessible name, rendered as an SVG <title>.
mirroredbooleanfalseFlips the icon horizontally.

Size, color and accessibility

<GithubIcon size={48} alt="Github logo" className="shrink-0" />

Monochrome Github icon

The /mono entry point exports a single-color version that follows currentColor, so it inherits your text color in light and dark themes.

import { GithubIcon } from "@dev.icons/react/mono";

<GithubIcon color="var(--text-muted)" />

TypeScript and Server Components

Components are typed and have no hooks, so they render in React Server Components, the Next.js app router and any SSR setup. Named imports keep the bundle to the icons you use.

import type { ComponentProps } from "react";
import { GithubIcon } from "@dev.icons/react";

type LogoProps = ComponentProps<typeof GithubIcon>;

export function StackLogo(props: LogoProps) {
  return <GithubIcon size={24} alt="Github" {...props} />;
}

Also available