npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

flowbite-react-icons

v1.1.0

Published

Official Flowbite Icons library for React

Downloads

5,545

Readme

flowbite-react-icons

Official React package of Flowbite Icons.

Installation

# npm
npm i flowbite-react-icons

# yarn
yarn add flowbite-react-icons

# pnpm
pnpm add flowbite-react-icons

# bun
bun add flowbite-react-icons

Usage

The icons are separated into outline and solid endpoints to enable having a one-to-one parity with the svg file naming convention.

Outline

// outline

import { AngleDown } from "flowbite-react-icons/outline";

function Component() {
  return <AngleDown />;
}

Solid

// solid

import { AngleDown } from "flowbite-react-icons/solid";

function Component() {
  return <AngleDown />;
}

Provider

FlowbiteIcons is the context provider that extends the FlowbiteIconProps interface and is used to set a global config for all icons that it wraps.

Usage

import { FlowbiteIcons } from "flowbite-react-icons";
import {
  AngleDown,
  AngleLeft,
  AngleRight,
  AngleUp,
} from "flowbite-react-icons/outline";

function Component() {
  return (
    // all will have 48px `width` and `height`
    <FlowbiteIcons size={48}>
      <AngleDown />
      <AngleLeft />
      <AngleRight />
      <AngleUp />
    </FlowbiteIcons>
  );
}

Nesting

FlowbiteIcons context provider can be nested and it inherits values from parent contexts, allowing easy decoupled composability.

import { FlowbiteIcons } from "flowbite-react-icons";
import { AngleDown } from "flowbite-react-icons/outline";

function Component() {
  return (
    <FlowbiteIcons size={48}>
      <AngleDown /> {/* [width, height] = 48 */}
      <FlowbiteIcons color="red">
        <AngleDown /> {/* [width, height] = 48; color = red; */}
      </FlowbiteIcons>
    </FlowbiteIcons>
  );
}

Props priority

Inline props take precedence over what is provided by the FlowbiteIcons context provider.

import { FlowbiteIcons } from "flowbite-react-icons";
import { AngleDown } from "flowbite-react-icons/outline";

function Component() {
  return (
    <FlowbiteIcons size={48}>
      <AngleDown /> {/* [width, height] = 48 */}
      <FlowbiteIcons size={16}>
        <AngleDown /> {/* [width, height] = 16 */}
      </FlowbiteIcons>
    </FlowbiteIcons>
  );
}

Note: width and height also take precedence over size prop.

import { FlowbiteIcons } from "flowbite-react-icons";
import { AngleDown } from "flowbite-react-icons/outline";

function Component() {
  return (
    <FlowbiteIcons size={48}>
      <AngleDown /> {/* [width, height] = 48 */}
      <FlowbiteIcons height={16}>
        <AngleDown /> {/* width = 48, height = 16 */}
      </FlowbiteIcons>
    </FlowbiteIcons>
  );
}

Override with inline icon props:

import { FlowbiteIcons } from "flowbite-react-icons";
import { AngleDown } from "flowbite-react-icons/outline";

function Component() {
  return (
    <FlowbiteIcons size={48}>
      <AngleDown /> {/* [width, height] = 48 */}
      <AngleDown size={16} /> {/* [width, height] = 16 */}
    </FlowbiteIcons>
  );
}

SSR (Server-side rendering)

All icons are server-ready including FlowbiteIcons context provider. Values set in FlowbiteIcons will be both rendered on the server and on the client avoiding client-side hydration warning (eg: Next.js issue).

FlowbiteIcons is a polymorphic context allowing it to run both on server and client with the same data.

Bring your icon

Need more custom SVG icons but don't want to lose the FlowbiteIcons context provider powers as well as all your global config settings?

=> BaseIcon component is also exposed giving access to the FlowbiteIcons context provider values.

Create

// circle-user-icon.tsx

import { BaseIcon } from "flowbite-react-icons";

export function CircleUserIcon() {
  return (
    <BaseIcon
      fill="none"
      strokeWidth="2"
      strokeLinecap="round"
      strokeLinejoin="round"
    >
      <circle cx="12" cy="12" r="10" />
      <circle cx="12" cy="10" r="3" />
      <path d="M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662" />
    </BaseIcon>
  );
}

Usage

// page.tsx

import { FlowbiteIcons } from "flowbite-react-icons";
import { CircleUserIcon } from "./circle-user-icon";

function Component() {
  return (
    <FlowbiteIcons size={48}>
      <CircleUserIcon />
    </FlowbiteIcons>
  );
}

Default values

BaseIcon applies the following default values to props:

| name | value | | ------- | -------------------------- | | xmlns | http://www.w3.org/2000/svg | | viewBox | 0 0 24 24 |

Types

export interface FlowbiteIconProps extends SVGProps<SVGSVGElement> {
  /**
   * Sets both `width` and `height`
   *
   * @default 24
   */
  size?: number;
}