@dava96/osrs-icons 1.0.13 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -30,14 +30,37 @@ function MyComponent() {
30
30
 
31
31
  Each export is a fully formed CSS cursor value (e.g. `url('data:image/png;base64,...'), auto`).
32
32
 
33
- ### Raw Base64
33
+ ### As an Image
34
34
 
35
- If you need just the data URL for use outside of CSS:
35
+ Use the `toDataUrl` helper to extract the raw data URL for use outside of CSS:
36
+
37
+ ```tsx
38
+ import { abyssalWhip, dragonScimitar, toDataUrl } from '@dava96/osrs-icons';
39
+
40
+ // Single icon
41
+ <img src={toDataUrl(abyssalWhip)} alt="Abyssal Whip" />
42
+
43
+ // Multiple icons at once
44
+ const urls = toDataUrl({
45
+ whip: abyssalWhip,
46
+ sword: dragonScimitar,
47
+ });
48
+ // urls.whip → "data:image/png;base64,..."
49
+ // urls.sword → "data:image/png;base64,..."
50
+ ```
51
+
52
+ ### Icon Discovery
53
+
54
+ Browse all available icons programmatically with `iconNames`, or restrict values to valid names with the `IconName` type:
36
55
 
37
56
  ```ts
38
- import { abyssalWhip } from '@dava96/osrs-icons';
57
+ import { iconNames, type IconName } from '@dava96/osrs-icons';
58
+
59
+ // Search / autocomplete
60
+ const results = iconNames.filter(name => name.includes('dragon'));
39
61
 
40
- const dataUrl = abyssalWhip.replace(/url\('(.*)'\), auto/, '$1');
62
+ // Type-safe icon references
63
+ function setCustomCursor(name: IconName) { /* ... */ }
41
64
  ```
42
65
 
43
66
  ### CDN Usage (No Build Step)