pqoqubbw-icons

repository·main·Indexed 27 days ago

https://github.com/pqoqubbw/icons

A library of animated icons provided as React components, including a registry via ICON_LIST for programmatic discovery and search using names and keywords. The package manages icon assets and font configurations, utilizing a hybrid delivery approach for proprietary fonts like GT-Cinetype and Andale Mono to comply with licensing restrictions.

Tokens
1.3K
Snippets
3
Records
11
Agent score
93%

What's inside pqoqubbw-icons

  1. Local development font setup

    main

    For local development, no manual font configuration is required. The project automatically uses Google Fonts (Geist) instead of the proprietary fonts. You can start development immediately by running:

    pnpm install && pnpm dev
  2. Set up fonts for production on Vercel

    main

    Because proprietary font files (.woff) are excluded from the repository for licensing reasons, you must provide download URLs via environment variables in your Vercel deployment. The prebuild script will automatically download these fonts during the build process.

    Required environment variables:

    • FONT_DOWNLOAD_URL_GT_CINETYPE: The URL to the GT-Cinetype-Regular.woff file in your Vercel Blob Storage.
    • FONT_DOWNLOAD_URL_ANDALE_MONO: The URL to the ANDALEMO.woff file in your Vercel Blob Storage.
    FONT_DOWNLOAD_URL_GT_CINETYPE=https://your-blob-url.vercel-storage.com/GT-Cinetype-Regular-xxx.woff
    FONT_DOWNLOAD_URL_ANDALE_MONO=https://your-blob-url.vercel-storage.com/ANDALEMO-xxx.woff
  3. Font licensing and distribution rules

    main

    The project uses proprietary fonts (GT-Cinetype-Regular.woff and ANDALEMO.woff) that are subject to strict licensing.

    Compliance Rules:

    • Allowed: Using the fonts on websites via @font-face.
    • Prohibited: Distributing font files in public repositories.
    • Prohibited: Sharing font files publicly.

    To maintain compliance, font files are included in .gitignore and are only fetched from secure storage during production builds.

  4. Access the icon registry via ICON_LIST

    main
    The ICON_LIST constant provides a sorted registry of all available animated icons in the library. Each entry in the list is an object containing the icon's unique name, the icon component itself, and an array of keywords used for searching or categorization. You can use this list to programmatically discover available icons or implement a search feature.
  5. Import animated icons from the library

    main
    The pqoqubbw/pqoqubbw/icons library provides a large collection of animated icons as React components. You can import specific icons directly from the main entrypoint. Each icon is exported as a React component (e.g., AArrowDownIcon, AccessibilityIcon, GithubIcon).
  6. Reference the available animated icons and keywords

    main
    The library provides a large collection of animated icons, each associated with a unique name, an icon component, and a list of keywords for searching. Use the name to identify the specific icon or the keywords to find relevant icons for your UI context (e.g., searching 'money' will return icons like dollar-sign, euro, etc.).
  7. Identify available icons by name and keywords

    main

    The library provides a collection of animated icons. Each icon is identified by a unique name and can be discovered using a list of associated keywords. This metadata is useful for building search or selection interfaces.

    Common icon categories include:

    • Navigation/Arrows: arrow-up, arrow-down, corner-up-right, chevron-first.
    • Communication: phone, mail, message-circle, send, mic.
    • Files/Folders: folder-open, folder-lock, folder-git, folder-archive.
    • Social/Web: facebook, twitter, linkedin, instagram, discord.
    • Weather: cloud-rain, sun-moon, snowflake, thermometer.
    • Tools/Work: hammer, wrench, pickaxe, briefcase-business.
    • Finance: wallet, credit-card, receipt, receipt-euro.
    • Security: lock, key, eye-off, badge-alert.
  8. Reference the ICON_LIST schema

    main

    Each object within the ICON_LIST array follows this structure:

    • name: (string) The unique identifier for the icon.
    • icon: (Component) The animated icon component.
    • keywords: (string[]) An array of strings used for searching the icon.
  9. ServerIcon Props

    main

    The ServerIcon component accepts the following props:

    • size (number): The width and height of the SVG icon in pixels. Defaults to 28.
    • className (string): Additional CSS classes for the container div.
    • onMouseEnter (function): Callback triggered when the mouse enters the icon. Note: If a ref is provided, this callback is required to handle animation logic manually.
    • onMouseLeave (function): Callback triggered when the mouse leaves the icon. Note: If a ref is provided, this callback is required to handle animation logic manually.
    • ...props: Any standard HTMLAttributes<HTMLDivElement>.
  10. Control ServerIcon animations via ServerIconHandle

    main

    When you pass a ref to the ServerIcon component, you gain access to the ServerIconHandle interface, allowing you to programmatically control the animation state. Providing a ref switches the component from automatic hover-based animation to manual control.

    export interface ServerIconHandle {
      startAnimation: () => void;
      stopAnimation: () => void;
    }
  11. Use the ServerIcon component

    main

    The ServerIcon component renders an animated SVG icon representing a server. It features a built-in animation where the top and bottom rectangles move apart on hover.

    By default, the icon is uncontrolled and triggers animations automatically on onMouseEnter and onMouseLeave. If you provide a ref using ServerIconHandle, the component becomes controlled, and you must manually trigger animations via the ref methods.