You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-32Lines changed: 15 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,23 +33,17 @@ Make sure you add the following to your `theme.css` file.
33
33
34
34
## Usage
35
35
36
-
The alerts can be used in your `infolists` or `forms`, make sure you pick the right component.
36
+
Make sure to import the `SimpleAlert` component at the top of your file:
37
37
38
38
```php
39
39
use CodeWithDennis\SimpleAlert\Components\SimpleAlert;
40
-
```
40
+
````
41
41
42
-
```php
43
-
use CodeWithDennis\SimpleAlert\Components\SimpleAlert;
44
-
```
42
+
### Predefined Alerts
45
43
46
-
### Simple Alerts
47
-
48
-
There are 4 types of simple alerts: `danger`, `info`, `success`, and `warning`.
44
+
There are 4 types predefined of simple alerts: `danger`, `info`, `success`, and `warning`.
49
45
50
46
```php
51
-
use CodeWithDennis\SimpleAlert\Components\SimpleAlert;
52
-
53
47
SimpleAlert::make('example')
54
48
->danger()
55
49
->info()
@@ -60,8 +54,6 @@ SimpleAlert::make('example')
60
54
If you would like to use a [different color](https://filamentphp.com/docs/3.x/support/colors), you can use the `color` method.
61
55
62
56
```php
63
-
use CodeWithDennis\SimpleAlert\Components\SimpleAlert;
64
-
65
57
SimpleAlert::make('example')
66
58
->color('purple')
67
59
```
@@ -71,22 +63,24 @@ SimpleAlert::make('example')
71
63
By default, simple alerts come with an icon. For example, the `->danger()` method includes a `heroicon-s-x-circle` icon. If you want to use a different icon, you can use the icon method.
72
64
73
65
```php
74
-
use CodeWithDennis\SimpleAlert\Components\SimpleAlert;
You can add animation to the icon by passing the animation type as the second parameter to the `icon` method. Make sure to use the `IconAnimation` enum for the animation type.
87
82
88
83
```php
89
-
use CodeWithDennis\SimpleAlert\Components\SimpleAlert;
90
84
use CodeWithDennis\SimpleAlert\Components\Enums\IconAnimation;
91
85
92
86
SimpleAlert::make('example')
@@ -98,8 +92,6 @@ SimpleAlert::make('example')
98
92
You can change the vertical alignment of the icon by using the `iconVerticalAlignment` method.
99
93
100
94
```php
101
-
use CodeWithDennis\SimpleAlert\Components\SimpleAlert;
102
-
103
95
SimpleAlert::make('example')
104
96
->iconVerticalAlignment('start'), // possible values: start, center
105
97
```
@@ -109,8 +101,6 @@ SimpleAlert::make('example')
109
101
You can add a title to the alert by using the `title` method.
110
102
111
103
```php
112
-
use CodeWithDennis\SimpleAlert\Components\SimpleAlert;
113
-
114
104
SimpleAlert::make('example')
115
105
->title('Hoorraayy! Your request has been approved! 🎉')
116
106
```
@@ -120,8 +110,6 @@ SimpleAlert::make('example')
120
110
You can add a description to the alert by using the `description` method.
121
111
122
112
```php
123
-
use CodeWithDennis\SimpleAlert\Components\SimpleAlert;
124
-
125
113
SimpleAlert::make('example')
126
114
->description('This is the description')
127
115
```
@@ -131,8 +119,6 @@ SimpleAlert::make('example')
131
119
You can add a border to the alert by using the `border` method.
132
120
133
121
```php
134
-
use CodeWithDennis\SimpleAlert\Components\SimpleAlert;
135
-
136
122
SimpleAlert::make('example')
137
123
->border()
138
124
```
@@ -141,8 +127,7 @@ SimpleAlert::make('example')
141
127
You can also add actions to the alert by using the `actions` method. All regular action features are supported.
142
128
143
129
```php
144
-
use CodeWithDennis\SimpleAlert\Components\SimpleAlert;
145
-
use Filament\Forms\Components\Actions;
130
+
use Filament\Actions\Action;
146
131
147
132
SimpleAlert::make('example')
148
133
->columnSpanFull()
@@ -163,8 +148,7 @@ SimpleAlert::make('example')
163
148
You can change the vertical alignment of the actions by using the `actionsVerticalAlignment` method.
164
149
165
150
```php
166
-
use CodeWithDennis\SimpleAlert\Components\SimpleAlert;
167
-
use Filament\Forms\Components\Actions;
151
+
use Filament\Actions\Action;
168
152
169
153
SimpleAlert::make('example')
170
154
->actionsVerticalAlignment('start'), // possible values: start, center
@@ -174,8 +158,7 @@ SimpleAlert::make('example')
174
158
### Example
175
159
176
160
```php
177
-
use CodeWithDennis\SimpleAlert\Components\SimpleAlert;
0 commit comments