Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #42 from shopware/add-vite-example-to-readme
Browse files Browse the repository at this point in the history
Add vite example to readme
  • Loading branch information
jleifeld authored Apr 25, 2023
2 parents e4d2400 + d20ed87 commit dea5d03
Showing 1 changed file with 34 additions and 3 deletions.
37 changes: 34 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ $ yarn -v
- [Table of contents](#table-of-contents)
- [Installation](#installation)
- [Usage](#usage)
- [Vite example](#example)
- [Built With](#built-with)
- [Figma library](#figma-library)
- [License](#license)
Expand Down Expand Up @@ -70,9 +71,7 @@ import wallet from '@shopware-ag/meteor-icon-kit/icons/regular/wallet.svg';
Take this pseudo html:
```html
<span class="icon-example">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<!--- ... -->
</svg>
<wallet />
</span>
```

Expand All @@ -93,6 +92,38 @@ By defining the following class structure in `CSS` you can change the color of t
}
```

## Example

Following is an example for a Vue3 project using Vite as a bundler.
We are using the `vite-svg-loader` to load the svg files.

In your `vite.config.js` add the following:
```js
//...
import svgLoader from 'vite-svg-loader';

export default {
plugins: [
//...
svgLoader()
],
};

```

This way you can import your svg files as components:
```vue
<template>
<ActivityIcon />
</template>
<script setup>
import ActivityIcon from '@shopware-ag/meteor-icon-kit/icons/regular/activity.svg';
</script>
```

You can find this example as a CodeSandbox template [here](https://codesandbox.io/p/sandbox/meteor-icon-kit-example-revdlr).

## Built With

* Typescript
Expand Down

0 comments on commit dea5d03

Please sign in to comment.