aark-react-modalify 1.2.2 → 1.3.1

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
@@ -1,330 +1,521 @@
1
- # AARK React Modalify 🚀
1
+ # AARK React Modalify
2
2
 
3
- A lightweight, flexible React modal and notification library with TypeScript support. Features automatic DOM mounting, customizable styling, and a simple imperative API for displaying modals, alerts, confirmations, and toast notifications.
3
+ A lightweight, flexible React modal and notification library with TypeScript support. Features automatic DOM mounting, customizable styling via CSS variables, responsive size presets, and a simple imperative API.
4
4
 
5
- ## ✨ Features
5
+ [![npm version](https://img.shields.io/npm/v/aark-react-modalify)](https://www.npmjs.com/package/aark-react-modalify)
6
+ [![license](https://img.shields.io/npm/l/aark-react-modalify)](LICENSE)
6
7
 
7
- - **Zero Dependencies**: Pure React implementation
8
- - **TypeScript Support**: Full type safety out of the box
9
- - **Dual API**: Component-based OR props-based configuration
10
- - **Automatic CSS**: Styles included automatically or import separately
11
- - **Portal Rendering**: Modals render outside your component tree
12
- - **Accessibility**: Built-in keyboard navigation and focus management
13
- - **Customizable**: CSS variables for complete theme control
14
- - **Multiple Positions**: Various positioning options for modals and notifications
15
- - **Animation Support**: Smooth fade and slide animations
16
- - **Hook Integration**: useModal hook for advanced use cases
8
+ ## Features
17
9
 
18
- ## 📦 Installation
10
+ - **Zero runtime dependencies** — pure React + ReactDOM
11
+ - **TypeScript** — full type safety out of the box
12
+ - **Dual API** — pass raw JSX _or_ a plain props object
13
+ - **Size presets** — `sm / md / lg / xl / full` with explicit `width` / `maxWidth` override
14
+ - **Responsive** — adapts automatically on tablet and mobile
15
+ - **CSS variables** — theme every visual property without touching JS
16
+ - **Imperative** — call `aark.fire()` / `aark.notification()` anywhere, no context required
17
+ - **Portal rendering** — modal root managed automatically, no wrapping provider needed
18
+ - **Accessibility** — ESC key, overlay click, and focus management built in
19
+
20
+ ---
21
+
22
+ ## Installation
19
23
 
20
24
  ```bash
25
+ # npm
21
26
  npm install aark-react-modalify
27
+
28
+ # pnpm
29
+ pnpm add aark-react-modalify
30
+
31
+ # yarn
32
+ yarn add aark-react-modalify
22
33
  ```
23
34
 
24
- ## 🚀 Quick Start
35
+ **Peer dependencies:** `react >= 16.8.0`, `react-dom >= 16.8.0`
25
36
 
26
- ### Component-Based Approach
37
+ ---
38
+
39
+ ## Quick Start
27
40
 
28
- ```jsx
41
+ ### Component-based (pass any JSX)
42
+
43
+ ```tsx
29
44
  import { aark } from "aark-react-modalify";
30
45
 
31
46
  function App() {
32
- const openModal = () => {
33
- aark.fire(
34
- <div>
35
- <h2>Hello World!</h2>
36
- <p>This is a simple modal.</p>
37
- <button onClick={() => aark.close()}>Close</button>
38
- </div>,
39
- {
40
- position: "center",
41
- showCloseIcon: true,
42
- }
43
- );
44
- };
45
-
46
- return <button onClick={openModal}>Open Modal</button>;
47
+ const openModal = () => {
48
+ aark.fire(
49
+ <div>
50
+ <h2>Hello World!</h2>
51
+ <p>This is a simple modal.</p>
52
+ <button onClick={() => aark.close()}>Close</button>
53
+ </div>,
54
+ { position: "center", showCloseIcon: true }
55
+ );
56
+ };
57
+
58
+ return <button onClick={openModal}>Open Modal</button>;
47
59
  }
48
60
  ```
49
61
 
50
- ### Props-Based Approach
62
+ ### Props-based (built-in styled templates)
51
63
 
52
- ```jsx
64
+ ```tsx
53
65
  import { aark } from "aark-react-modalify";
54
66
 
55
- function App() {
56
- const showConfirmation = () => {
57
- aark.fire({
58
- title: "Delete Item",
59
- text: "Are you sure you want to delete this item?",
60
- type: "warning",
61
- showCancelButton: true,
62
- confirmText: "Yes, delete it!",
63
- cancelText: "Cancel",
64
- onConfirm: () => {
65
- aark.notification({
66
- title: "Deleted!",
67
- text: "The item has been deleted successfully.",
68
- type: "success",
69
- timer: 3000,
70
- });
71
- },
72
- });
73
- };
74
-
75
- return <button onClick={showConfirmation}>Delete Item</button>;
76
- }
67
+ aark.fire({
68
+ title: "Delete Item",
69
+ text: "Are you sure you want to delete this item?",
70
+ type: "warning",
71
+ showCancelButton: true,
72
+ confirmText: "Yes, delete it!",
73
+ cancelText: "Cancel",
74
+ onConfirm: () => {
75
+ aark.notification(
76
+ { title: "Deleted!", text: "The item has been deleted.", type: "success", timer: 3000 },
77
+ { position: "top-right" }
78
+ );
79
+ },
80
+ });
77
81
  ```
78
82
 
79
- ## 📚 API Reference
83
+ > **Note:** `position` and other display options for notifications go in the **second argument** (`NotificationOptions`), not inside the props object.
80
84
 
81
- ### Modal Methods
85
+ ---
82
86
 
83
- #### `aark.fire(content, options?)` or `aark.fire(props)`
87
+ ## API Reference
84
88
 
85
- **Component-based:**
89
+ ### `aark.fire(content, options?)` — component-based modal
86
90
 
87
- ```jsx
88
- aark.fire(<YourComponent />, options);
91
+ ```tsx
92
+ aark.fire(<YourComponent />, options?: ModalOptions);
89
93
  ```
90
94
 
91
- **Props-based:**
95
+ ### `aark.modal(content, options?)` — alias for `aark.fire`
92
96
 
93
- ```jsx
94
- aark.fire({
95
- title: "Modal Title",
96
- text: "Modal content",
97
- type: "info", // "success" | "error" | "warning" | "info" | "question"
98
- showCancelButton: true,
99
- confirmText: "OK",
100
- cancelText: "Cancel",
101
- onConfirm: () => {},
102
- onCancel: () => {},
103
- });
97
+ ```tsx
98
+ aark.modal(<YourComponent />, options?: ModalOptions);
104
99
  ```
105
100
 
106
- ### Notification Methods
107
-
108
- #### `aark.notification(content, options?)` or `aark.notification(props)`
109
-
110
- **Component-based:**
111
-
112
- ```jsx
113
- aark.notification(<YourNotification />, options);
101
+ ### `aark.fire(props, options?)` — props-based modal
102
+
103
+ ```tsx
104
+ aark.fire(
105
+ {
106
+ title?: string;
107
+ text?: string;
108
+ type?: "success" | "error" | "warning" | "info" | "question";
109
+ icon?: string | ReactNode;
110
+ html?: string | ReactNode; // string → dangerouslySetInnerHTML, ReactNode → rendered as JSX
111
+ confirmText?: string; // default: "OK"
112
+ cancelText?: string; // default: "Cancel"
113
+ showCancelButton?: boolean; // default: false
114
+ showConfirmButton?: boolean; // default: true
115
+ reverseButtons?: boolean; // swap confirm/cancel order
116
+ onConfirm?: () => void;
117
+ onCancel?: () => void;
118
+ width?: string | number; // e.g. "500px", "80%", 600
119
+ fullWidth?: boolean;
120
+ padding?: string | number;
121
+ customClass?: {
122
+ popup?: string;
123
+ header?: string;
124
+ title?: string;
125
+ icon?: string;
126
+ content?: string;
127
+ confirmButton?: string;
128
+ cancelButton?: string;
129
+ footer?: string;
130
+ };
131
+ },
132
+ options?: ModalOptions // position, size, showCloseIcon, etc.
133
+ );
114
134
  ```
115
135
 
116
- **Props-based:**
136
+ ### `aark.notification(content, options?)` — component-based notification
117
137
 
118
- ```jsx
119
- aark.notification({
120
- title: "Notification Title",
121
- text: "Notification message",
122
- type: "success",
123
- timer: 3000,
124
- position: "top-right",
125
- });
138
+ ```tsx
139
+ aark.notification(<YourToast />, options?: NotificationOptions);
126
140
  ```
127
141
 
128
- ### Other Methods
129
-
130
- ```jsx
131
- aark.close(); // Close current modal
132
- aark.closeAll(); // Close all modals and notifications
133
- aark.isOpen(); // Check if any modal is open
142
+ ### `aark.notification(props, options?)` — props-based notification
143
+
144
+ ```tsx
145
+ aark.notification(
146
+ {
147
+ title?: string;
148
+ text?: string;
149
+ type?: "success" | "error" | "warning" | "info" | "question";
150
+ icon?: string | ReactNode;
151
+ html?: string | ReactNode; // string → dangerouslySetInnerHTML, ReactNode → rendered as JSX
152
+ timer?: number; // auto-close in ms (default: 5000)
153
+ showCloseButton?: boolean; // default: true
154
+ clickToClose?: boolean; // default: true
155
+ width?: string | number;
156
+ fullWidth?: boolean;
157
+ padding?: string | number;
158
+ customClass?: {
159
+ popup?: string;
160
+ header?: string;
161
+ title?: string;
162
+ icon?: string;
163
+ content?: string;
164
+ };
165
+ },
166
+ options?: NotificationOptions // position, autoCloseTime, showCloseIcon, etc.
167
+ );
134
168
  ```
135
169
 
136
- ## ⚙️ Configuration Options
170
+ ### Other methods
137
171
 
138
- ### Modal Options
172
+ ```tsx
173
+ aark.close(); // close the current modal / notification
174
+ aark.closeAll(); // close everything
175
+ aark.isOpen(); // returns boolean
139
176
 
140
- | Option | Type | Default | Description |
141
- | --------------------- | --------------- | ---------- | ------------------------ |
142
- | `position` | `ModalPosition` | `"center"` | Modal position |
143
- | `showCloseIcon` | `boolean` | `false` | Show close button |
144
- | `clickOutsideToClose` | `boolean` | `true` | Close on backdrop click |
145
- | `escapeKeyToClose` | `boolean` | `true` | Close on ESC key |
146
- | `onOpen` | `() => void` | - | Called when modal opens |
147
- | `onClose` | `() => void` | - | Called when modal closes |
177
+ // Theme shortcuts (same as the standalone imported functions)
178
+ aark.setTheme(theme); // same as setAarkModalTheme(theme)
179
+ aark.resetTheme(); // same as resetAarkModalTheme()
180
+ aark.getTheme(); // same as getAarkModalTheme()
181
+ ```
148
182
 
149
- ### Notification Options
183
+ ---
150
184
 
151
- | Option | Type | Default | Description |
152
- | ----------------- | ---------------------- | ------------- | --------------------- |
153
- | `title` | `string` | - | Notification title |
154
- | `text` | `string` | - | Notification content |
155
- | `type` | `NotificationType` | `"info"` | Notification type |
156
- | `timer` | `number` | `0` | Auto-close timer (ms) |
157
- | `position` | `NotificationPosition` | `"top-right"` | Notification position |
158
- | `showCloseButton` | `boolean` | `true` | Show close button |
185
+ ## Configuration Options
186
+
187
+ ### `ModalOptions`
188
+
189
+ | Option | Type | Default | Description |
190
+ | --------------------- | ---------------- | ---------- | ---------------------------------------- |
191
+ | `position` | `ModalPosition` | `"center"` | Where the modal appears |
192
+ | `size` | `ModalSize` | | Preset max-width (`sm/md/lg/xl/full`) |
193
+ | `width` | `string\|number` | — | Explicit width, overrides `size` |
194
+ | `maxWidth` | `string\|number` | — | Explicit max-width, overrides `size` |
195
+ | `showCloseIcon` | `boolean` | `true` | Render the × close button |
196
+ | `className` | `string` | — | Extra class on the modal container |
197
+ | `overlayClassName` | `string` | — | Extra class on the backdrop |
198
+ | `preventOverlayClose` | `boolean` | `false` | Disable close on backdrop click |
199
+ | `preventEscClose` | `boolean` | `false` | Disable close on ESC key |
200
+
201
+ ### `NotificationOptions`
202
+
203
+ | Option | Type | Default | Description |
204
+ | ----------------- | ---------------------- | ------------- | ------------------------------------ |
205
+ | `position` | `NotificationPosition` | `"top-right"` | Where the notification appears |
206
+ | `autoCloseTime` | `number` | `5000` | Auto-dismiss delay in ms |
207
+ | `showCloseIcon` | `boolean` | `true` | Render the × close button |
208
+ | `className` | `string` | — | Extra class on the notification |
209
+ | `preventEscClose` | `boolean` | `false` | Disable dismiss on ESC key |
210
+
211
+ ### Size presets (`ModalSize`)
212
+
213
+ | Value | Max-width |
214
+ | ------ | ---------------- |
215
+ | `sm` | 400 px |
216
+ | `md` | 550 px |
217
+ | `lg` | 700 px (default) |
218
+ | `xl` | 900 px |
219
+ | `full` | 100 vw − 32 px |
220
+
221
+ ```tsx
222
+ // Use a preset
223
+ aark.fire(<Content />, { size: "xl" });
224
+
225
+ // Or set exact dimensions
226
+ aark.fire(<Content />, { width: "80%", maxWidth: "900px" });
227
+ ```
159
228
 
160
- ### Position Types
229
+ ### Position types
161
230
 
162
- ```typescript
231
+ ```ts
163
232
  type ModalPosition =
164
- | "center"
165
- | "top-center"
166
- | "top-left"
167
- | "top-right"
168
- | "bottom-center"
169
- | "bottom-left"
170
- | "bottom-right";
233
+ | "center"
234
+ | "top-center"
235
+ | "top-right"
236
+ | "bottom-center"
237
+ | "bottom-right";
171
238
 
172
239
  type NotificationPosition =
173
- | "top-left"
174
- | "top-center"
175
- | "top-right"
176
- | "bottom-left"
177
- | "bottom-center"
178
- | "bottom-right";
240
+ | "top-left"
241
+ | "top-center"
242
+ | "top-right"
243
+ | "bottom-left"
244
+ | "bottom-center"
245
+ | "bottom-right";
179
246
  ```
180
247
 
181
- ## 🎨 Customization
248
+ ---
249
+
250
+ ## Customization
182
251
 
183
- ### CSS Variables
252
+ ### CSS variables (full list with defaults)
253
+
254
+ Override any of these in your global CSS to theme the library without touching JS:
184
255
 
185
256
  ```css
186
257
  :root {
187
- --aark-modal-overlay-bg: rgba(0, 0, 0, 0.5);
188
- --aark-modal-bg: #fff;
189
- --aark-modal-radius: 8px;
190
- --aark-modal-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
191
- --aark-modal-pad: 16px;
192
- --aark-modal-z: 9999;
193
- --aark-notification-bg: #fff;
194
- --aark-notification-radius: 8px;
195
- --aark-notification-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
196
- --aark-notification-pad: 16px;
197
- --aark-notification-z: 10000;
198
- --aark-close-color: #666;
199
- --aark-close-hover: #f5f5f5;
200
- --aark-anim: 0.2s;
258
+ /* Overlay */
259
+ --aark-modal-overlay-bg: rgba(0, 0, 0, 0.5);
260
+ --aark-modal-overlay-blur: 0px;
261
+
262
+ /* Modal */
263
+ --aark-modal-bg: #fff;
264
+ --aark-modal-radius: 8px;
265
+ --aark-modal-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
266
+ --aark-modal-pad: 16px;
267
+ --aark-modal-max-width: 700px;
268
+ --aark-modal-z: 9999;
269
+
270
+ /* Close button */
271
+ --aark-close-color: #666;
272
+ --aark-close-hover: #f5f5f5;
273
+ --aark-close-hover-color: #333;
274
+ --aark-close-focus-outline: 2px solid #007bff;
275
+
276
+ /* Notification */
277
+ --aark-notification-bg: #fff;
278
+ --aark-notification-radius: 8px;
279
+ --aark-notification-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
280
+ --aark-notification-pad: 16px;
281
+ --aark-notification-z: 10000;
282
+
283
+ /* Animation */
284
+ --aark-anim: 0.2s;
201
285
  }
202
286
  ```
203
287
 
204
- ### CSS Import Options
288
+ ### `setAarkModalTheme(theme)` apply theme via JS
289
+
290
+ All properties are optional. Only the ones you pass are changed.
291
+
292
+ ```tsx
293
+ import { setAarkModalTheme } from "aark-react-modalify";
294
+ // or: aark.setTheme({ ... })
295
+
296
+ setAarkModalTheme({
297
+ // Overlay
298
+ overlayBackground: "rgba(0, 0, 0, 0.7)",
299
+ overlayBlur: "4px",
300
+
301
+ // Modal
302
+ modalBackground: "#1f2937",
303
+ modalBorderRadius: "12px",
304
+ modalShadow: "0 20px 60px rgba(0, 0, 0, 0.4)",
305
+ modalPadding: "24px",
306
+ modalMaxWidth: "600px",
307
+ modalZIndex: 9999,
308
+
309
+ // Close button
310
+ closeButtonColor: "#9ca3af",
311
+ closeButtonHoverBackground: "rgba(255,255,255,0.1)",
312
+ closeButtonHoverColor: "#fff",
313
+
314
+ // Notification
315
+ notificationBackground: "#111827",
316
+ notificationBorderRadius: "8px",
317
+ notificationShadow: "0 4px 20px rgba(0,0,0,0.3)",
318
+ notificationPadding: "12px 16px",
319
+ notificationZIndex: 10000,
320
+
321
+ // Animation
322
+ animationDuration: "0.3s",
323
+ });
324
+ ```
325
+
326
+ ### `resetAarkModalTheme()` — restore defaults
327
+
328
+ ```tsx
329
+ import { resetAarkModalTheme } from "aark-react-modalify";
330
+ // or: aark.resetTheme()
331
+
332
+ resetAarkModalTheme();
333
+ ```
334
+
335
+ ### `getAarkModalTheme()` — read current values
205
336
 
206
- **Option 1: Automatic (Default)**
337
+ ```tsx
338
+ import { getAarkModalTheme } from "aark-react-modalify";
339
+ // or: aark.getTheme()
207
340
 
208
- ```jsx
341
+ const theme = getAarkModalTheme();
342
+ console.log(theme.modalBackground); // e.g. "#fff"
343
+ ```
344
+
345
+ ---
346
+
347
+ ## CSS Import Options
348
+
349
+ **Option 1 — Automatic (default)**
350
+
351
+ ```tsx
209
352
  import { aark } from "aark-react-modalify";
210
- // CSS is included automatically
353
+ // CSS is bundled and injected automatically
211
354
  ```
212
355
 
213
- **Option 2: Manual Import**
356
+ **Option 2 Manual (no-styles build)**
357
+
358
+ Useful if you want full control over when/how the CSS is loaded:
214
359
 
215
- ```jsx
360
+ ```tsx
216
361
  import { aark } from "aark-react-modalify/no-styles";
217
362
  import "aark-react-modalify/css";
363
+ // or: import "aark-react-modalify/dist/aark-react-modalify.css";
218
364
  ```
219
365
 
220
- ## 🔧 Advanced Usage
366
+ ---
367
+
368
+ ## Advanced Usage
369
+
370
+ ### `useModal` hook
221
371
 
222
- ### Using with Hooks
372
+ Subscribe to modal state changes anywhere in your component tree:
223
373
 
224
- ```jsx
225
- import { useModal } from "aark-react-modalify";
374
+ ```tsx
375
+ import { aark, useModal } from "aark-react-modalify";
226
376
 
227
377
  function MyComponent() {
228
- const { openModal, closeModal, isOpen } = useModal();
229
-
230
- const handleOpen = () => {
231
- openModal(<div>My modal content</div>, { position: "center" });
232
- };
233
-
234
- return (
235
- <div>
236
- <button onClick={handleOpen}>Open Modal</button>
237
- {isOpen && <p>Modal is currently open</p>}
238
- </div>
239
- );
378
+ const { isOpen, config } = useModal();
379
+ // config.mode === "modal" | "notification"
380
+
381
+ return (
382
+ <div>
383
+ <button onClick={() => aark.fire(<div>Content</div>, { position: "center" })}>
384
+ Open
385
+ </button>
386
+ {isOpen && <p>A {config?.mode} is currently open</p>}
387
+ </div>
388
+ );
240
389
  }
241
390
  ```
242
391
 
243
- ### Theme Management
392
+ `useModal` returns:
244
393
 
245
- ```jsx
246
- import { setAarkModalTheme, resetAarkModalTheme } from "aark-react-modalify";
394
+ | Property | Type | Description |
395
+ |----------|------|-------------|
396
+ | `isOpen` | `boolean` | Whether a modal/notification is currently showing |
397
+ | `config` | `ComponentConfig \| null` | Current config object including `mode`, `content`, `props`, `options` |
398
+ | `close` | `() => void` | Close the current modal/notification |
247
399
 
248
- // Apply custom theme
249
- setAarkModalTheme({
250
- modalBg: "#1f2937",
251
- modalRadius: "12px",
252
- animationDuration: "0.3s",
253
- });
400
+ ### Manual component integration
254
401
 
255
- // Reset to defaults
256
- resetAarkModalTheme();
402
+ If you need to manage rendering yourself:
403
+
404
+ ```tsx
405
+ import { Modal, Notification, ModalProvider } from "aark-react-modalify";
257
406
  ```
258
407
 
259
- ## 💡 Examples
408
+ ---
409
+
410
+ ## Examples
260
411
 
261
- ### Success Modal
412
+ ### Success modal
262
413
 
263
- ```jsx
414
+ ```tsx
264
415
  aark.fire({
265
- title: "Success!",
266
- text: "Your data has been saved successfully.",
267
- type: "success",
268
- confirmText: "Great!",
416
+ title: "Saved!",
417
+ text: "Your changes have been saved successfully.",
418
+ type: "success",
419
+ confirmText: "Great!",
269
420
  });
270
421
  ```
271
422
 
272
- ### Confirmation Dialog
423
+ ### Confirmation dialog
273
424
 
274
- ```jsx
425
+ ```tsx
275
426
  aark.fire({
276
- title: "Delete Item",
277
- text: "This action cannot be undone.",
278
- type: "warning",
279
- showCancelButton: true,
280
- confirmText: "Yes, delete it!",
281
- cancelText: "Cancel",
282
- onConfirm: () => console.log("Item deleted"),
427
+ title: "Delete Item",
428
+ text: "This action cannot be undone.",
429
+ type: "warning",
430
+ showCancelButton: true,
431
+ confirmText: "Yes, delete it!",
432
+ cancelText: "Cancel",
433
+ onConfirm: () => console.log("deleted"),
283
434
  });
284
435
  ```
285
436
 
286
- ### Error Notification
437
+ ### Notification with position
287
438
 
288
- ```jsx
289
- aark.notification({
290
- title: "Error",
291
- text: "Something went wrong. Please try again.",
292
- type: "error",
293
- timer: 4000,
439
+ ```tsx
440
+ // position goes in options (second argument), not inside the props
441
+ aark.notification(
442
+ { title: "Error", text: "Something went wrong.", type: "error", timer: 4000 },
443
+ { position: "top-right" }
444
+ );
445
+ ```
446
+
447
+ ### Component-based notification
448
+
449
+ ```tsx
450
+ aark.notification(
451
+ <div style={{ padding: "1rem" }}>Custom toast content</div>,
452
+ { position: "bottom-right", autoCloseTime: 3000 }
453
+ );
454
+ ```
455
+
456
+ ### Large custom modal
457
+
458
+ ```tsx
459
+ aark.fire(<Dashboard />, {
460
+ size: "xl",
461
+ showCloseIcon: true,
462
+ preventOverlayClose: true,
463
+ });
464
+ ```
465
+
466
+ ### Modal with exact dimensions
467
+
468
+ ```tsx
469
+ aark.fire(<MyForm />, {
470
+ width: "600px",
471
+ maxWidth: "90vw",
472
+ position: "top-center",
294
473
  });
295
474
  ```
296
475
 
297
- ## 🌐 Framework Compatibility
476
+ ### Dark theme
298
477
 
299
- - ✅ **Vite** - CSS automatically processed
300
- - **Create React App** - Styles included in bundle
301
- - ✅ **Next.js** - Works with both App and Pages router
302
- - ✅ **Webpack** - CSS automatically bundled
303
- - ✅ **Parcel** - Styles processed automatically
478
+ ```tsx
479
+ import { setAarkModalTheme } from "aark-react-modalify";
304
480
 
305
- ## 📊 Bundle Size
481
+ setAarkModalTheme({
482
+ modalBackground: "#1f2937",
483
+ modalBorderRadius: "12px",
484
+ overlayBackground: "rgba(0, 0, 0, 0.8)",
485
+ overlayBlur: "4px",
486
+ notificationBackground: "#111827",
487
+ animationDuration: "0.3s",
488
+ });
489
+ ```
306
490
 
307
- - **JavaScript**: ~16 kB (minified)
308
- - **CSS**: ~9 kB (minified)
309
- - **Total**: ~25 kB
310
- - **Gzipped**: ~8 kB (estimated)
491
+ ---
311
492
 
312
- ## 🆚 Component vs Props-Based
493
+ ## Framework Compatibility
313
494
 
314
- | Feature | Component-Based | Props-Based |
315
- | --------------- | --------------------------- | --------------------------- |
316
- | **Flexibility** | Complete control over JSX | Predefined templates |
317
- | **Ease of Use** | Requires React knowledge | Simple object configuration |
318
- | **Styling** | Full CSS control | Built-in styled templates |
319
- | **Best for** | Complex UIs, custom designs | Quick alerts, confirmations |
495
+ | Framework | Support |
496
+ | ---------------------------- | ------- |
497
+ | Vite | |
498
+ | Next.js (App + Pages router) | |
499
+ | Create React App | |
500
+ | Webpack | |
501
+ | Parcel | ✅ |
320
502
 
321
- ## 📄 License
503
+ ---
504
+
505
+ ## Bundle Size
322
506
 
323
- MIT License - see the [LICENSE](LICENSE) file for details.
507
+ | Asset | Size (minified) |
508
+ | ---------- | --------------- |
509
+ | JavaScript | ~16 kB |
510
+ | CSS | ~5 kB |
511
+ | **Total** | **~21 kB** |
512
+ | Gzipped | ~7 kB (est.) |
513
+
514
+ ---
324
515
 
325
- ## 🤝 Contributing
516
+ ## License
326
517
 
327
- Contributions are welcome! Please feel free to submit a Pull Request.
518
+ MIT see [LICENSE](LICENSE) for details.
328
519
 
329
520
  ---
330
521