@marv3l/canopy-ui 1.0.2 → 1.0.4
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 +242 -212
- package/package.json +1 -1
- package/templates/toast/use-toast.ts +1 -1
package/README.md
CHANGED
|
@@ -1,261 +1,291 @@
|
|
|
1
|
-
# Canopy UI
|
|
1
|
+
# <img src="./public/favicon.ico" width="48" height="48" align="center" /> Canopy UI
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
<div align="center">
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
### Custom UI Components for React & Next.js
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
A modern npm package for building beautiful, customizable user interfaces.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
<br />
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
[](https://www.npmjs.com/package/canopy-ui)
|
|
12
|
+
[](https://www.typescriptlang.org/)
|
|
13
|
+
[](https://react.dev/)
|
|
14
|
+
[](https://nextjs.org/)
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
<br />
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
<a href="https://canopy-ui-web.vercel.app/">
|
|
19
|
+
|
|
20
|
+
<img src="https://img.shields.io/badge/Documentation-Canopy%20UI-7C3AED?style=for-the-badge&logo=readthedocs&logoColor=white" />
|
|
21
|
+
|
|
22
|
+
</a>
|
|
23
|
+
|
|
24
|
+
<a href="https://www.npmjs.com/package/canopy-ui">
|
|
25
|
+
|
|
26
|
+
<img src="https://img.shields.io/badge/npm-View%20Package-CB3837?style=for-the-badge&logo=npm&logoColor=white" />
|
|
27
|
+
|
|
28
|
+
</a>
|
|
29
|
+
|
|
30
|
+
<a href="https://github.com/ShawnR04/canopy-ui">
|
|
31
|
+
|
|
32
|
+
<img src="https://img.shields.io/badge/GitHub-Repository-181717?style=for-the-badge&logo=github&logoColor=white" />
|
|
33
|
+
|
|
34
|
+
</a>
|
|
35
|
+
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<br />
|
|
20
39
|
|
|
21
40
|
---
|
|
22
41
|
|
|
23
|
-
##
|
|
42
|
+
## <img src="https://api.iconify.design/lucide/book-open.svg?color=%233B82F6" width="25" /> About Canopy UI
|
|
43
|
+
|
|
44
|
+
**Canopy UI** is a customizable UI component library for **React** and **Next.js** applications.
|
|
45
|
+
|
|
46
|
+
The project is built around a simple idea: provide developers with modern, polished UI components that are easy to integrate and customize.
|
|
47
|
+
|
|
48
|
+
Canopy UI currently provides a **Toast notification component**, with additional components planned for the future.
|
|
49
|
+
|
|
50
|
+
> **Simple components. Flexible design. Built for your application.**
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## <img src="https://api.iconify.design/lucide/layers-3.svg?color=%238B5CF6" width="25" /> Components
|
|
55
|
+
|
|
56
|
+
<div align="center">
|
|
57
|
+
|
|
58
|
+
<table>
|
|
59
|
+
<tr>
|
|
60
|
+
|
|
61
|
+
<td align="center" width="50%">
|
|
62
|
+
|
|
63
|
+
<img src="https://api.iconify.design/lucide/bell.svg?color=%23F59E0B" width="42" />
|
|
64
|
+
|
|
65
|
+
<br /><br />
|
|
66
|
+
|
|
67
|
+
<b>Toast</b>
|
|
68
|
+
|
|
69
|
+
<br />
|
|
70
|
+
|
|
71
|
+
Customizable notification component with configurable variants, colors, positioning, durations, and styling.
|
|
72
|
+
|
|
73
|
+
<br /><br />
|
|
74
|
+
|
|
75
|
+
<img src="https://img.shields.io/badge/Available-22C55E?style=flat-square&logoColor=white" />
|
|
76
|
+
|
|
77
|
+
</td>
|
|
78
|
+
|
|
79
|
+
<td align="center" width="50%">
|
|
80
|
+
|
|
81
|
+
<img src="https://api.iconify.design/lucide/sparkles.svg?color=%238B5CF6" width="42" />
|
|
82
|
+
|
|
83
|
+
<br /><br />
|
|
84
|
+
|
|
85
|
+
<b>More Coming Soon</b>
|
|
86
|
+
|
|
87
|
+
<br />
|
|
88
|
+
|
|
89
|
+
Canopy UI is actively growing with additional components planned for future releases.
|
|
90
|
+
|
|
91
|
+
<br /><br />
|
|
92
|
+
|
|
93
|
+
<img src="https://img.shields.io/badge/Coming%20Soon-8B5CF6?style=flat-square&logoColor=white" />
|
|
94
|
+
|
|
95
|
+
</td>
|
|
96
|
+
|
|
97
|
+
</tr>
|
|
98
|
+
</table>
|
|
99
|
+
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## <img src="https://api.iconify.design/lucide/sparkles.svg?color=%23F59E0B" width="25" /> Features
|
|
105
|
+
|
|
106
|
+
<div align="center">
|
|
107
|
+
|
|
108
|
+
<table>
|
|
109
|
+
<tr>
|
|
110
|
+
|
|
111
|
+
<td align="center" width="25%">
|
|
112
|
+
|
|
113
|
+
<img src="https://api.iconify.design/lucide/palette.svg?color=%23EC4899" width="36" />
|
|
114
|
+
|
|
115
|
+
<br /><br />
|
|
116
|
+
|
|
117
|
+
<b>Customizable</b>
|
|
118
|
+
|
|
119
|
+
<br />
|
|
24
120
|
|
|
25
|
-
|
|
121
|
+
Designed to adapt to your application's visual style.
|
|
26
122
|
|
|
27
|
-
|
|
123
|
+
</td>
|
|
28
124
|
|
|
29
|
-
|
|
30
|
-
- Configurable global default duration
|
|
31
|
-
- Configurable screen position
|
|
32
|
-
- Per-toast duration overrides
|
|
33
|
-
- Custom colors using hex values, CSS variables, or design tokens
|
|
34
|
-
- Progress-bar color controls
|
|
35
|
-
- Direct Tailwind `className` overrides
|
|
125
|
+
<td align="center" width="25%">
|
|
36
126
|
|
|
37
|
-
|
|
127
|
+
<img src="https://api.iconify.design/lucide/code-2.svg?color=%238B5CF6" width="36" />
|
|
38
128
|
|
|
39
|
-
|
|
129
|
+
<br /><br />
|
|
40
130
|
|
|
41
|
-
|
|
42
|
-
npx canopy-ui add toast
|
|
43
|
-
```
|
|
131
|
+
<b>Developer Friendly</b>
|
|
44
132
|
|
|
45
|
-
|
|
133
|
+
<br />
|
|
46
134
|
|
|
47
|
-
|
|
48
|
-
components/ui/toast.tsx
|
|
49
|
-
components/ui/use-toast.ts
|
|
50
|
-
```
|
|
135
|
+
Built with modern React and TypeScript.
|
|
51
136
|
|
|
52
|
-
>
|
|
137
|
+
</td>
|
|
138
|
+
|
|
139
|
+
<td align="center" width="25%">
|
|
140
|
+
|
|
141
|
+
<img src="https://api.iconify.design/lucide/zap.svg?color=%23F59E0B" width="36" />
|
|
142
|
+
|
|
143
|
+
<br /><br />
|
|
144
|
+
|
|
145
|
+
<b>Lightweight</b>
|
|
146
|
+
|
|
147
|
+
<br />
|
|
148
|
+
|
|
149
|
+
Focused components without unnecessary complexity.
|
|
150
|
+
|
|
151
|
+
</td>
|
|
152
|
+
|
|
153
|
+
<td align="center" width="25%">
|
|
154
|
+
|
|
155
|
+
<img src="https://api.iconify.design/lucide/settings-2.svg?color=%233B82F6" width="36" />
|
|
156
|
+
|
|
157
|
+
<br /><br />
|
|
158
|
+
|
|
159
|
+
<b>Flexible</b>
|
|
160
|
+
|
|
161
|
+
<br />
|
|
162
|
+
|
|
163
|
+
Designed to work with your existing application and design system.
|
|
164
|
+
|
|
165
|
+
</td>
|
|
166
|
+
|
|
167
|
+
</tr>
|
|
168
|
+
</table>
|
|
169
|
+
|
|
170
|
+
</div>
|
|
53
171
|
|
|
54
172
|
---
|
|
55
173
|
|
|
56
|
-
##
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
description: "My application",
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export default function RootLayout({
|
|
83
|
-
children,
|
|
84
|
-
}: Readonly<{
|
|
85
|
-
children: React.ReactNode;
|
|
86
|
-
}>) {
|
|
87
|
-
return (
|
|
88
|
-
<html
|
|
89
|
-
lang="en"
|
|
90
|
-
className={`${geistSans.variable} ${geistMono.variable} h-full antialiased`}
|
|
91
|
-
>
|
|
92
|
-
<body className="flex min-h-full flex-col">
|
|
93
|
-
{children}
|
|
94
|
-
<Toaster defaultDuration={3500} position="top-center" />
|
|
95
|
-
</body>
|
|
96
|
-
</html>
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### `Toaster` Props
|
|
102
|
-
|
|
103
|
-
| Prop | Type | Description |
|
|
104
|
-
| --- | --- | --- |
|
|
105
|
-
| `defaultDuration` | `number` | Default time, in milliseconds, before a toast dismisses. Individual toasts can override it. |
|
|
106
|
-
| `position` | `string` | Position of the toast viewport, for example `"top-center"`. |
|
|
174
|
+
## <img src="https://api.iconify.design/lucide/book-open.svg?color=%233B82F6" width="25" /> Documentation
|
|
175
|
+
|
|
176
|
+
The complete Canopy UI documentation is available on the official documentation site.
|
|
177
|
+
|
|
178
|
+
It includes:
|
|
179
|
+
|
|
180
|
+
* Component installation
|
|
181
|
+
* Configuration
|
|
182
|
+
* Usage
|
|
183
|
+
* API references
|
|
184
|
+
* Customization
|
|
185
|
+
* Examples
|
|
186
|
+
* CLI documentation
|
|
187
|
+
|
|
188
|
+
<div align="center">
|
|
189
|
+
|
|
190
|
+
<a href="https://canopy-ui-web.vercel.app/">
|
|
191
|
+
|
|
192
|
+
<img src="https://img.shields.io/badge/Read%20the%20Documentation-7C3AED?style=for-the-badge&logo=readthedocs&logoColor=white" />
|
|
193
|
+
|
|
194
|
+
</a>
|
|
195
|
+
|
|
196
|
+
</div>
|
|
107
197
|
|
|
108
198
|
---
|
|
109
199
|
|
|
110
|
-
##
|
|
200
|
+
## <img src="https://api.iconify.design/lucide/layers.svg?color=%2306B6D4" width="25" /> Tech Stack
|
|
111
201
|
|
|
112
|
-
|
|
202
|
+
<div align="center">
|
|
113
203
|
|
|
114
|
-
|
|
115
|
-
|
|
204
|
+
[](https://react.dev/)
|
|
205
|
+
[](https://nextjs.org/)
|
|
206
|
+
[](https://www.typescriptlang.org/)
|
|
207
|
+
[](https://www.npmjs.com/)
|
|
116
208
|
|
|
117
|
-
|
|
209
|
+
</div>
|
|
118
210
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## <img src="https://api.iconify.design/lucide/heart.svg?color=%23EC4899" width="25" /> Philosophy
|
|
214
|
+
|
|
215
|
+
Canopy UI is built around a simple principle:
|
|
216
|
+
|
|
217
|
+
> **Build beautiful UI without unnecessary complexity.**
|
|
218
|
+
|
|
219
|
+
Components should be easy to integrate, easy to customize, and flexible enough to fit into different applications.
|
|
220
|
+
|
|
221
|
+
Canopy UI aims to provide a growing collection of components that developers can rely on when building modern interfaces.
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## <img src="https://api.iconify.design/lucide/rocket.svg?color=%23EF4444" width="25" /> Roadmap
|
|
226
|
+
|
|
227
|
+
Canopy UI currently includes:
|
|
228
|
+
|
|
229
|
+
* <img src="https://api.iconify.design/lucide/check-circle-2.svg?color=%2322C55E" width="18" /> Toast
|
|
230
|
+
|
|
231
|
+
Additional components are planned for future releases.
|
|
135
232
|
|
|
136
233
|
---
|
|
137
234
|
|
|
138
|
-
##
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
```tsx
|
|
153
|
-
toast({
|
|
154
|
-
variant: "error",
|
|
155
|
-
title: "Action failed",
|
|
156
|
-
description: "Could not connect to the remote server.",
|
|
157
|
-
});
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
### Custom Colors and Duration
|
|
161
|
-
|
|
162
|
-
Use `customColor` to override the toast palette. Values can be literal CSS colors, such as hex values, or CSS custom properties such as `var(--primary)`.
|
|
163
|
-
|
|
164
|
-
```tsx
|
|
165
|
-
toast({
|
|
166
|
-
title: "Pro subscription unlocked",
|
|
167
|
-
description: "Welcome to VIP perks and custom styling.",
|
|
168
|
-
duration: 5000,
|
|
169
|
-
customColor: {
|
|
170
|
-
bg: "var(--card)",
|
|
171
|
-
border: "var(--primary)",
|
|
172
|
-
text: "var(--card-foreground)",
|
|
173
|
-
icon: "var(--primary)",
|
|
174
|
-
progress: "var(--primary)",
|
|
175
|
-
},
|
|
176
|
-
});
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
### Tailwind Class Override
|
|
180
|
-
|
|
181
|
-
Use `className` when you want to apply direct Tailwind utility classes to an individual toast.
|
|
182
|
-
|
|
183
|
-
```tsx
|
|
184
|
-
toast({
|
|
185
|
-
title: "Tailwind classes applied",
|
|
186
|
-
description: "Styled with direct className overrides.",
|
|
187
|
-
duration: 3500,
|
|
188
|
-
customColor: {
|
|
189
|
-
progress: "var(--destructive)",
|
|
190
|
-
},
|
|
191
|
-
className: "border-destructive/40 bg-card text-primary",
|
|
192
|
-
});
|
|
193
|
-
```
|
|
235
|
+
## <img src="https://api.iconify.design/lucide/github.svg?color=%23181717" width="25" /> Repository
|
|
236
|
+
|
|
237
|
+
Canopy UI is open source and available on GitHub.
|
|
238
|
+
|
|
239
|
+
<div align="center">
|
|
240
|
+
|
|
241
|
+
<a href="https://github.com/ShawnR04/canopy-ui">
|
|
242
|
+
|
|
243
|
+
<img src="https://img.shields.io/badge/View%20Source%20Code-GitHub-181717?style=for-the-badge&logo=github&logoColor=white" />
|
|
244
|
+
|
|
245
|
+
</a>
|
|
246
|
+
|
|
247
|
+
</div>
|
|
194
248
|
|
|
195
249
|
---
|
|
196
250
|
|
|
197
|
-
##
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
title?: string;
|
|
203
|
-
description?: string;
|
|
204
|
-
duration?: number;
|
|
205
|
-
customColor?: {
|
|
206
|
-
bg?: string;
|
|
207
|
-
border?: string;
|
|
208
|
-
text?: string;
|
|
209
|
-
icon?: string;
|
|
210
|
-
progress?: string;
|
|
211
|
-
};
|
|
212
|
-
className?: string;
|
|
213
|
-
});
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
| Option | Description |
|
|
217
|
-
| --- | --- |
|
|
218
|
-
| `variant` | Applies a built-in visual style, such as `"success"` or `"error"`. |
|
|
219
|
-
| `title` | Primary toast message. |
|
|
220
|
-
| `description` | Supporting text displayed below the title. |
|
|
221
|
-
| `duration` | Dismiss timeout in milliseconds. Overrides `Toaster`’s `defaultDuration`. |
|
|
222
|
-
| `customColor.bg` | Toast background color. |
|
|
223
|
-
| `customColor.border` | Toast border color. |
|
|
224
|
-
| `customColor.text` | Toast text color. |
|
|
225
|
-
| `customColor.icon` | Toast icon color. |
|
|
226
|
-
| `customColor.progress` | Toast progress-bar color. |
|
|
227
|
-
| `className` | Tailwind or custom CSS classes applied directly to the toast. |
|
|
251
|
+
## <img src="https://api.iconify.design/lucide/scale.svg?color=%2322C55E" width="25" /> License
|
|
252
|
+
|
|
253
|
+
Canopy UI is licensed under the **MIT License**.
|
|
254
|
+
|
|
255
|
+
Copyright © 2026 **Shawn Rimai**
|
|
228
256
|
|
|
229
257
|
---
|
|
230
258
|
|
|
231
|
-
|
|
259
|
+
<div align="center">
|
|
260
|
+
|
|
261
|
+
<img src="./public/favicon.ico" width="42" height="42" align="center" />
|
|
262
|
+
|
|
263
|
+
### Canopy UI
|
|
264
|
+
|
|
265
|
+
**Custom UI. Simple integration. Flexible design.**
|
|
266
|
+
|
|
267
|
+
<br />
|
|
268
|
+
|
|
269
|
+
<a href="https://canopy-ui-web.vercel.app/">
|
|
232
270
|
|
|
233
|
-
|
|
271
|
+
<img src="https://img.shields.io/badge/Documentation-Visit%20Canopy%20UI-7C3AED?style=for-the-badge&logo=readthedocs&logoColor=white" />
|
|
234
272
|
|
|
235
|
-
|
|
236
|
-
npm run build
|
|
237
|
-
```
|
|
273
|
+
</a>
|
|
238
274
|
|
|
239
|
-
|
|
275
|
+
<a href="https://www.npmjs.com/package/canopy-ui">
|
|
240
276
|
|
|
241
|
-
|
|
242
|
-
npm link
|
|
243
|
-
```
|
|
277
|
+
<img src="https://img.shields.io/badge/npm-Canopy%20UI-CB3837?style=for-the-badge&logo=npm&logoColor=white" />
|
|
244
278
|
|
|
245
|
-
|
|
279
|
+
</a>
|
|
246
280
|
|
|
247
|
-
|
|
248
|
-
canopy-ui add toast
|
|
249
|
-
```
|
|
281
|
+
<a href="https://github.com/ShawnR04/canopy-ui">
|
|
250
282
|
|
|
251
|
-
|
|
283
|
+
<img src="https://img.shields.io/badge/GitHub-ShawnR04-181717?style=for-the-badge&logo=github&logoColor=white" />
|
|
252
284
|
|
|
253
|
-
|
|
285
|
+
</a>
|
|
254
286
|
|
|
255
|
-
|
|
256
|
-
npm publish --access public
|
|
257
|
-
```
|
|
287
|
+
<br /><br />
|
|
258
288
|
|
|
259
|
-
|
|
289
|
+
<sub>Built by Shawn Rimai</sub>
|
|
260
290
|
|
|
261
|
-
|
|
291
|
+
</div>
|
package/package.json
CHANGED
|
@@ -48,7 +48,7 @@ export interface ToastItem extends ToastOptions {
|
|
|
48
48
|
// Maximum number of visible toast cards on screen simultaneously
|
|
49
49
|
const TOAST_LIMIT = 5;
|
|
50
50
|
// Delay before removed toasts are completely purged from memory (allows exit transition)
|
|
51
|
-
const TOAST_REMOVE_DELAY =
|
|
51
|
+
const TOAST_REMOVE_DELAY = 500;
|
|
52
52
|
|
|
53
53
|
// Discriminated union type representing all possible reducer actions
|
|
54
54
|
type Action =
|