Webcomponents library 'pd-icon' for rendering dynamic and static SVG icons using Lit.
npm install @progressive-development/pd-iconThis webcomponent follows the open-wc recommendation.
``bash`
npm install @progressive-development/pd-icon
To use the
`bash
`
If you want to programmatically use the PdIcon class or access other constants and utilities:
`bash
import { PdIcon } from '@progressive-development/pd-icon';
// Example: manually define the custom element
if (!customElements.get('pd-icon')) {
customElements.define('pd-icon', PdIcon);
}
`
You can also import additional exports like constants or utilities:
`bash`
import { NAME_XYZ } from '@progressive-development/pd-icon';
console.log(NAME_XYZ);
Local Development Server with Vite
To start a local development server for this component, run:
`bash`
npm run start
This uses Vite and serves the project with hot module replacement.
To build the component for production, run:
`bash`
npm run build
The output will be located in the dist/ folder, ready for publishing or consumption in other projects.
To preview the built component in a local server:
`bash`
npm run preview
This runs a local server to inspect the production build in dist/.
`bash`
npm run lint
To automatically fix linting and formatting errors, run:
`bash`
npm run format
To execute a single test run:
`bash`
npm run test
To run the tests in interactive watch mode, run:
`bash`
npm run test:watch
To run a local instance of Storybook for your component, run:
`bash`
npm run storybook
To build a production version of Storybook, run:
`bash``
npm run build-storybook