-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
37 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,74 @@ | ||
# Whoosh | ||
|
||
## Project setup | ||
|
||
``` | ||
npm install @adecrown/whoosh | ||
or | ||
yarn add @adecrown/whoosh | ||
``` | ||
|
||
## Basic Usage | ||
|
||
Inside your main.js file | ||
|
||
```javascript | ||
import Whoosh from '@adecrown/whoosh' | ||
Vue.use(Whoosh) | ||
import Whoosh from "@adecrown/whoosh"; | ||
Vue.use(Whoosh); | ||
``` | ||
|
||
then inside your App.vue file use Whoosh like this | ||
|
||
``` | ||
<Whoosh/> | ||
``` | ||
|
||
Whoosh can then be called anywhere like this | ||
|
||
```javascript | ||
this.$whoosh({ | ||
status:'error', | ||
title:'Something went wrong', | ||
message:'We could not find the id' | ||
}) | ||
status: "error", | ||
title: "Something went wrong", | ||
message: "We could not find the id" | ||
}); | ||
``` | ||
|
||
### API | ||
|
||
```javascript | ||
this.$whoosh({ | ||
// (optional) Notification status 'success,warn,error' | ||
// custom status can also be passed here | ||
status: 'success', | ||
|
||
// (optional) Notification title | ||
title: 'I am the title', | ||
this.$whoosh({ | ||
// (optional) Notification status 'success,warn,error' | ||
// custom status can also be passed here | ||
status: "success", | ||
|
||
// (optional) Notification message | ||
message: 'I am the message', | ||
// (optional) Notification title | ||
title: "I am the title", | ||
|
||
// (optional) This will override the default duration and the provided duration mains.js | ||
duration: 5, | ||
// (optional) Notification message | ||
message: "I am the message", | ||
|
||
// (optional) This will override the size and the provided prop size | ||
size: { | ||
width:400, | ||
height:250 | ||
} | ||
// (optional) This will override the default duration and the provided duration mains.js | ||
duration: 5, | ||
|
||
}) | ||
``` | ||
|
||
// (optional) This will override the size and the provided prop size | ||
size: { | ||
width: 400, | ||
height: 250 | ||
} | ||
}); | ||
``` | ||
|
||
### Props Table | ||
|
||
All props below are optional. | ||
|
||
| Name | Type | Default | Description | | ||
| --- | --- | --- | --- | | ||
| duration | Number | 5 | how long you want the notification to stay on for (5 equals 5 seconds) | | ||
| fill | Boolean | false | fill the whole card with the status color | | ||
| closeOnClick | Boolean | false | notification will only close when it's clicked on | | ||
| textColor | String | black | set the text color to what you prefer | | ||
| size | Object | {width:500,height:210}| use it to set your prefered width and height| | ||
|
||
|
||
| Name | Type | Default | Description | | ||
| ------------- | ------- | ---------------------- | ---------------------------------------------------------------------- | | ||
| duration | Number | 5 | how long you want the notification to stay on for (5 equals 5 seconds) | | ||
| fill | Boolean | false | fill the whole card with the status color | | ||
| closeOnClick | Boolean | false | notification will only close when it's clicked on | | ||
| textColor | String | black | set the text color to what you prefer | | ||
| progressColor | String | #dcd9d9 | set the progress color to what you prefer | | ||
| size | Object | {width:500,height:210} | use it to set your prefered width and height | |