3.7.1 • Published 1 year ago

@purpurds/icon-dynamic v3.7.1

Weekly downloads
-
License
AGPL-3.0-only
Repository
-
Last release
1 year ago

import { Meta, Stories, ArgTypes, Primary, Subtitle } from "@storybook/blocks";

import * as IconDynamicStories from "./src/icon-dynamic.stories"; import packageInfo from "./package.json";

IconDynamic

Version {packageInfo.version}

Use this component when the icon is dynamic, i.e. it's unknown beforehand which icon should be used.

Showcase

Properties

Installation

Via NPM

Add the dependency to your consumer app like "@purpurds/icon-dynamic": "x.y.z"

Since the component is dependent on styling from the Icon component, add that dependency as well: "@purpurds/icon": "x.y.z"


In MyApp.tsx

import "@purpurds/icon/styles";

In MyComponent.tsx

import { IconDynamic } from "@purpurds/icon-dynamic";
import type { IconName } from "@purpurds/icon";

type Props = {
  icon: IconName;
};

export const MyComponent = ({ icon }: Props) => {
  return (
    <div>
      <IconDynamic name={icon} size="xs" />
    </div>
  );
};
3.7.1

1 year ago

3.7.0

1 year ago

3.6.0

1 year ago

3.5.1

1 year ago

3.5.0

1 year ago

3.4.0

1 year ago

3.3.2

1 year ago

3.3.1

1 year ago

3.3.0

1 year ago

3.2.0

1 year ago

3.1.0

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.8.0

1 year ago