1.0.23 • Published 3 years ago

sp-react-notifications v1.0.23

Weekly downloads
-
License
MIT
Repository
-
Last release
3 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

3 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago