r3d-icons 1.1.18 → 1.1.19
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 +14 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ A premium, interactive React component library for high-fidelity 3D and 2D vecto
|
|
|
28
28
|
Install the package and its peer dependencies:
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
npm install
|
|
31
|
+
npm install r3d-icons three @react-three/fiber @react-three/drei
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
---
|
|
@@ -37,7 +37,7 @@ npm install react-3d-icons three @react-three/fiber @react-three/drei
|
|
|
37
37
|
|
|
38
38
|
```jsx
|
|
39
39
|
import React from "react";
|
|
40
|
-
import { ShieldIcon, CrownIcon } from "
|
|
40
|
+
import { ShieldIcon, CrownIcon } from "r3d-icons";
|
|
41
41
|
|
|
42
42
|
function App() {
|
|
43
43
|
return (
|
|
@@ -64,8 +64,8 @@ export default App;
|
|
|
64
64
|
The library provides strict TypeScript definitions for all component parameters. You can import type interfaces directly, including type-only imports to preserve a minimal runtime bundle footprint:
|
|
65
65
|
|
|
66
66
|
```typescript
|
|
67
|
-
import { ShieldIcon } from "
|
|
68
|
-
import type { ShieldIconProps, IconPreset } from "
|
|
67
|
+
import { ShieldIcon } from "r3d-icons";
|
|
68
|
+
import type { ShieldIconProps, IconPreset } from "r3d-icons";
|
|
69
69
|
|
|
70
70
|
const config: ShieldIconProps = {
|
|
71
71
|
preset: "glassmorphism", // strictly validated literal presets
|
|
@@ -79,6 +79,16 @@ export default function Card() {
|
|
|
79
79
|
|
|
80
80
|
---
|
|
81
81
|
|
|
82
|
+
## WebGL Memory & Context Management
|
|
83
|
+
|
|
84
|
+
To prevent browser crashes and screen flickering caused by WebGL context limits (usually a maximum of 8–16 active contexts per page), the library automatically handles cleanup:
|
|
85
|
+
|
|
86
|
+
- **Instant Garbage Collection:** On component unmount, `r3d-icons` instantly forces the browser to discard the WebGL context using the native `WEBGL_lose_context` extension.
|
|
87
|
+
- **Resource Disposal:** All materials, geometries, and renderer structures are automatically disposed of during unmounting.
|
|
88
|
+
- **Responsive 2D Fallbacks:** For layouts displaying grids of many icons simultaneously, use the `variant="2d"` prop to run lightweight vector graphics without creating WebGL contexts.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
82
92
|
## API Properties Reference
|
|
83
93
|
|
|
84
94
|
Every icon component accepts the following customizable props:
|