@cardog-icons/react

中文文档
1.2.0发布于 2026/03/15MITTypeScriptESM + CJS近 30 天下载 3.3万

Car brand icons for React applications

原始使用文档
文档目录12 节
  1. Features
  2. Installation
  3. Usage
  4. Importing specific icons
  5. Using the generic Icon component
  6. Using the useIcon hook
  7. Icon Variants
  8. Available Icon Types
  9. Naming Examples
  10. Available Brands
  11. Props
  12. License

@cardog-icons/react

React components for car brand logos and icons.

Features

  • 380+ optimized SVG icons for car brands
  • Two variants: Color (default) and Mono (dark mode optimized)
  • TypeScript support with full type definitions
  • Tree-shakable, only import what you need
  • Easy customization of size, color, and other SVG props
  • Lightweight and fast

Installation

npm install @cardog-icons/react
# or
yarn add @cardog-icons/react
# or
pnpm add @cardog-icons/react

Usage

Importing specific icons

import {
  BMWLogo,
  BMWLogoDark,
  AudiIcon,
  TeslaWordmark,
} from "@cardog-icons/react";

function App() {
  return (
    <div>
      {/* Color variants (default) */}
      <BMWLogo size={48} />
      <AudiIcon size={32} />
      <TeslaWordmark height={24} width={120} />

      {/* Mono/Dark variants - great for dark mode */}
      <BMWLogoDark size={48} className="text-white" />
    </div>
  );
}

Using the generic Icon component

import { Icon } from "@cardog-icons/react";

function App() {
  return (
    <div>
      <Icon name="BMWLogo" size={48} />
      <Icon name="BMWLogoDark" size={48} />
      <Icon name="AudiIcon" size={32} />
    </div>
  );
}

Using the useIcon hook

import { useIcon } from "@cardog-icons/react";

function CustomIcon({ name, ...props }) {
  const icon = useIcon({ name, ...props });

  return <div className="custom-icon-wrapper">{icon}</div>;
}

Icon Variants

Each brand comes in two variants:

VariantSuffixDescription
Color(none)Full-color brand logos for light backgrounds
MonoDarkSingle-color icons for dark mode UIs

Available Icon Types

  • Icon: Compact badge/emblem icon
  • Logo: Full brand logo
  • LogoHorizontal: Horizontal logo with text
  • Wordmark: Text-only brand name

Naming Examples

TypeColorMono
IconBMWIconBMWIconDark
LogoBMWLogoBMWLogoDark
HorizontalBMWLogoHorizontalBMWLogoHorizontalDark
WordmarkBMWWordmarkBMWWordmarkDark

Available Brands

Acura, Alfa Romeo, Aston Martin, Audi, Bentley, BMW, Bugatti*, Buick*, BYD, Cadillac, Chevrolet, Chrysler, Dodge, Ferrari, Fiat, Ford, Genesis, GMC, Honda, Hummer, Hyundai, Infiniti, Jaguar, Jeep, Kia, Koenigsegg*, Lamborghini, Land Rover, Lexus, Lincoln, Lotus, Lucid, Maserati, Mazda, Mercedes-Benz, McLaren, Mini, Mitsubishi, Nissan, Pagani*, Polestar, Porsche, RAM, Rivian*, Rolls-Royce, Subaru, Tesla, Toyota, VinFast, Volkswagen, Volvo

*Mono variant only

Props

All icon components accept the following props:

PropTypeDefaultDescription
sizenumber | string24Size for both width and height
widthnumber | string-Override width
heightnumber | string-Override height
classNamestring-CSS class name
...svgPropsReact.SVGProps<SVGSVGElement>-Any valid SVG prop

License

MIT © Cardog

版本与发布记录

@cardog-icons/react 共发布 5 个版本,首次发布于 2025/03/11;过去 12 个月发布了 3 个版本。

版本发布日期距今
1.2.0latest2026/03/157 个月前
1.1.12025/12/0811 个月前
1.1.02025/12/0811 个月前
1.0.12025/03/121.7 年前
1.0.02025/03/111.7 年前

关于 @cardog-icons/react 的常见问题

@cardog-icons/react 是什么?

Car brand icons for React applications

如何安装 @cardog-icons/react?

在项目目录运行 npm install @cardog-icons/react,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@cardog-icons/react 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@cardog-icons/react 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@cardog-icons/react 可以商用吗?

@cardog-icons/react 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@cardog-icons/react 的下载量有多少?

根据 npm 官方下载统计,@cardog-icons/react 在 2026/10/09 – 2026/11/07 这 30 天内被下载 32,914 次,日均约 1,097 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@cardog-icons/react 还在维护吗?

最新版本 1.2.0 发布于 2026/03/15(7 个月前);至今共发布 5 个版本,其中过去 12 个月发布了 3 个;首次发布于 2025/03/11。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。