The icon set for WARP, imported from (Figma project)[https://www.figma.com/file/yEx16ew6S0Xgd579dN4hsM/Warp---Icons?type=design&node-id=150-113&mode=design&t=TRtIuPlsDoYlbuqd-0].
Note that the icons in the "src/raw" folder in this repository should never be used directly, as they aren't optimized. Also note that Raw icons don't contain title element and hence won't follow accessibility guidelines
npm install @warp-ds/icons
import { IconBag16 } from '@warp-ds/icons/react';
<IconBag16 />
npm install @warp-ds/icons
import { IconChevronRight16 } from '@warp-ds/icons/vue';
<icon-chevron-right-16 />
You will need to install both Warp Elements and Lit Element which is the library we use for custom elements
npm install lit @warp-ds/icons
Import elements icons once to use them in the entire app. Once imported, run your script through whatever bundling process your app uses (Rollup, Esbuild, etc) after which the component can be used in the page.
import '@warp-ds/icons/elements';
<w-icon-attachment-16></w-icon-attachment-16>
<w-icon-attachment-24></w-icon-attachment-24>
Or import individual icons:
import "@warp-ds/icons/elements/alert-16";
<w-icon-alert-16></w-icon-alert-16>
Run the following command to install dependencies:
pnpm install
When adding icons to @warp-ds/icons follow these steps:
- Add all the icon files to the correct folder in src/raw/ directory. Follow this pattern:
src/raw/{icon-name}/icon_{size}.svg
- Add description for the new icons to default-icon-descriptions.js and run
pnpm i18n:get-sorted-locales
to sort the translations alphabetically. Follow this pattern:
arrowleft: {
message: "Leftward-pointing arrow", // We only describe what the icon looks like - not what is its potential purpose.
id: "icon.title.arrow-left", // the last part reflects the name of the folder
comment: "Title for arrow left icon" // This comment will serve as help for the internationalisation team to provide correct translation of the icon description
},
- Generate locales files and build the icons:
pnpm build
You can open a local preview of the icons. Use this to verify that the icons look as they should. Run the following command:
pnpm dev
We are bundling types now for all named exports. To make Typescript compiler compliant to these changes you'll need to use "module": "NodeNext"
in your tsconfig and then all the imports would have types.
This project is continuously published to NPM using a next
tag (e.g. 1.1.0-next.1
).
Anyone needing to use the latest changes of this package can point to the next
version while waiting for the stable release.
Detailed changes for each release can be found in the CHANGELOG file.
@warp-ds/icons is available under the Apache-2.0 software license.