1.0.23 • Published 2 years ago

sp-react-notifications v1.0.23

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

sp-notification

Simple notification package for Sharepoint Framework React Webparts

Install

npm install sp-react-notifications

Dependencies

Project is supposed to be used within Sharepoint Framework react WebParts, and it assumes following packages:

  • react & react-dom ^16.13.1
  • office-ui-fabric-react ^7.174.1
  • uuid

Usage

import { SPnotify } from 'sp-notifications';

// ...

<button onClick={() => SPnotify({
    // text shown on the notification, can also be a ReactElement for more sophisticated notifications
    message: "Test message",
    // constant from office-ui-fabric-react. Optional, default = info
    messageType: MessageBarType.severeWarning, 
    // buttons shown on the notification. Optional, default = true
    isMultiline: false,
    // Timeout (in miliseconds) after withc the notification is dismissed. Optional, default = 5000
    timeout: 5000,
    // Additional buttons appearing on the notification. Optional, default []
    messageActions: [ 
        {
            text: 'Yes',
            onClick: () => console.log('text'),
            dismiss: true,
        },
        {
            text: 'No',
            onClick: () => console.log('notext'),
        }
    ]
})}>
    notify me
</button>
1.0.23

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago