Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shonya3/poe-custom-elements
Path of Exile custom elements
https://github.com/shonya3/poe-custom-elements
customelements pathofexile webcomponents
Last synced: 3 months ago
JSON representation
Path of Exile custom elements
- Host: GitHub
- URL: https://github.com/shonya3/poe-custom-elements
- Owner: shonya3
- License: mit
- Created: 2024-04-25T18:25:39.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-08-26T05:08:31.000Z (5 months ago)
- Last Synced: 2024-10-01T03:01:21.918Z (4 months ago)
- Topics: customelements, pathofexile, webcomponents
- Language: TypeScript
- Homepage:
- Size: 4.59 MB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# poe-custom-elements
Path of Exile custom elements
```bash
npm install poe-custom-elements
```## Usage
Here is an example with a stash tab
First, you need to open node_modules/poe-custom-elements and copy `poe-ce-assets` dir to your `public` folder.
```js
import 'poe-custom-elements/stash-tab.js';
/*
JS object of stash tab from Poe API
https://www.pathofexile.com/developer/docs/reference#stashes-get
Check TabWithItems, PoeItem .d.ts types file
(Keep in mind, that exact json importing is a Vite feature, not a real JS)
*/
import quad from './QuadStashStd.json';const el = document.createElement('poe-stash-tab');
el.tab = quad;
document.body.append(el);
```Check [JS Example](https://github.com/shonya3/poe-custom-elements/tree/main/examples/js)
#### Customizing base path for assets
By default, you need to copy assets folder from `node_modules/poe-custom-elements/dist/poe-ce-assets` to your `public` folder.
So that your public folder has `poe-ce-assets` folder. You can customize this path.
```js
import { setBasePath } from 'poe-custom-elements/lib/base_path.js';
setBasePath('/poe');
```