@ndla/icons
v8.0.43-alpha.0
Published
A package containing icons used in NDLA frontends
Downloads
4,329
Keywords
Readme
ndla-icons
A package containing icons used in NDLA frontends
Installation
yarn add @ndla/icons
npm install @ndla/icons --save
Usage
import { VoicePrintLine } from "@ndla/icons/common";
import { CameraFill } from "@ndla/icons/editor";
const IconList = () => (
<ul>
<li>
<VoicePrintLine /> Audio icon
</li>
<li>
<CameraFill /> Camera icon
</li>
</ul>
);
or
import { VoicePrintLine } from "@ndla/icons/lib/common/VoicePrintLine";
<VoicePrintLine />;
Icons are currently grouped into four folders
- common
- license
- editor
- contentType
Development
TLDR: Change/Add/Remove svg file(s). Run node scripts/createTsIconComponents.mjs
. Commit.
Add new svg file:
- Add svg file to an appropiate folder in ndla-icons/svg.
- Ensure that
data-license
anddata-source
attributes are on the<svg>
element. - Run
node scripts/createTsIconComponents.mjs
from root folder. - Commit changes.
Edit svg file:
- Edit existing svg file.
- Run
node scripts/createTsIconComponents.mjs
from root folder. - Commit changes.
Delete svg file:
- Delete svg file.
- Run
node scripts/createTsIconComponents.mjs
from root folder. - Commit changes.
Rename or add new folders
- Do changes.
- Run
node scripts/createTsIconComponents.mjs
from root folder. - Update files array in packages.json.