Skip to content

Commit 603e8a0

Browse files
committed
added alert default style example
1 parent 734ea85 commit 603e8a0

File tree

4 files changed

+54
-0
lines changed

4 files changed

+54
-0
lines changed

config/components.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ export const componentConfig = {
66
name: "accordion",
77
filePath: "packages/ui/Accordions/Accordion.tsx",
88
},
9+
alert: {
10+
name: "alert",
11+
filePath: "packages/ui/Alerts/Alert.tsx",
12+
},
913
avatar: {
1014
name: "avatar",
1115
filePath: "packages/ui/Avatars/Avatar.tsx",
@@ -31,6 +35,11 @@ export const componentConfig = {
3135
() => import("@/preview/components/accordion-style-default")
3236
),
3337
},
38+
"alert-style-default": {
39+
name: "alert-style-default",
40+
filePath: "preview/components/alert-style-default.tsx",
41+
preview: lazy(() => import("@/preview/components/alert-style-default")),
42+
},
3443
"avatar-style-circle": {
3544
name: "avatar-style-circle",
3645
filePath: "preview/components/avatar-style-circle.tsx",

config/navigation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const navConfig: INavigationConfig = {
1717
title: "Components",
1818
children: [
1919
{ title: "Accordion", href: `${componentsRoute}/accordion` },
20+
{ title: "Alert", href: `${componentsRoute}/alert` },
2021
{ title: "Avatar", href: `${componentsRoute}/avatar` },
2122
{ title: "Badge", href: `${componentsRoute}/badge` },
2223
{ title: "Button", href: `${componentsRoute}/button` },

content/docs/components/alert.mdx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: Alert
3+
description: Notify your users about important events and updates. 📣
4+
lastUpdated: 24 Oct, 2024
5+
---
6+
7+
<ComponentShowcase name="alert-style-default" />
8+
<br />
9+
<br />
10+
11+
## Installation
12+
13+
#### 1. Install dependencies:
14+
15+
```sh
16+
npm install class-variance-authority
17+
```
18+
19+
<br />
20+
21+
#### 2. Copy the code 👇 into your project:
22+
23+
<ComponentSource name="alert" />
24+
25+
<br />
26+
<br />
27+
28+
## Examples
29+
30+
### Default
31+
32+
<ComponentShowcase name="alert-style-default" />
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Alert } from "@/packages/ui";
2+
3+
export default function AlertStyleDefault() {
4+
return (
5+
<Alert>
6+
<Alert.Title>Heads up!</Alert.Title>
7+
<Alert.Description>
8+
You can add components to your app using the cli.
9+
</Alert.Description>
10+
</Alert>
11+
);
12+
}

0 commit comments

Comments
 (0)