1.1.4 • Published 9 months ago

@cdztt/message-react v1.1.4

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

Usage

  1. npm i @cdztt/message-react

  2. sample code:

import { Message, useMessage } from '@cdztt/message-react'

function SayHi() {
    const message = useMessage()
    return (
        <button onClick={() => message.show({ content: 'Hi' })}>
            Say Hi
        </button>
    )
}

function Page() {
    return (
        <Message>
            <SayHi></SayHi>
        </Message>
    )
}
  • API

Methods: | Methods | Parameters | Type | Description | | ----------- | ---------- | -------- | ------------------- | | show | (opts) | (Object) | Display a message. |

Parameters: | opts | Properties | Type | Units | Default | | ----------- | ---------- | -------- | ------- | -------------- | | | content | String | | 'please enter' | | | type | String | | 'info' | | | top | Number | px | 100 | | | fontSize | Number | rem | 1 | | | duration | Number | second | 1.5 |

Properties: | type | Value | | ----------- | --------- | | | 'info' | | | 'success' | | | 'warning' | | | 'error' |

1.1.4

9 months ago

1.1.0

1 year ago

1.0.7

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago