useNotice

useNotice is a custom hook that controls the notifications of the application.

Usage

import { useNotice } from "@yamada-ui/react"
const notice = useNotice()

Change Variant

Change Color Scheme

Change Loading Scheme

Change Status

To change the status, set the status to "info" or "success" etc.

Change Limit

To change the limit, set the limit to a number.

Change Duration

To change the duration, set the duration to a number.

Keep Stay

To keep the notice staying, set the duration to null.

Change Placement

To change the placement, set the placement to "start" or "end" etc.

Change Close Strategy

To change the close strategy, set the closeStrategy to "click" or "drag" etc.

Close Notice

To close the notice, use close or closeAll.

Update Notice

To update the notice, use update.

Configuration

Make Notice Always Expand

To make the notice always expand, set the expand to true.

import { UIProvider, extendConfig } from "@yamada-ui/react"

const config = extendConfig({
  notice: {
    expand: true,
  },
})

const App = () => {
  return (
    <UIProvider config={config}>
      <YourApplication />
    </UIProvider>
  )
}

Change Placement

To change the placement, set the placement to "start" or "end" etc.

import { UIProvider, extendConfig } from "@yamada-ui/react"

const config = extendConfig({
  notice: {
    placement: "end-end",,
  },
})

const App = () => {
  return (
    <UIProvider config={config}>
      <YourApplication />
    </UIProvider>
  )
}

Change Limit

To change the limit, set the limit to a number.

import { UIProvider, extendConfig } from "@yamada-ui/react"

const config = extendConfig({
  notice: {
    limit: 5,
  },
})

const App = () => {
  return (
    <UIProvider config={config}>
      <YourApplication />
    </UIProvider>
  )
}

Change Close Strategy

To change the close strategy, set the closeStrategy to "click" or "drag" etc.

import { UIProvider, extendConfig } from "@yamada-ui/react"

const config = extendConfig({
  notice: {
    closeStrategy: "click",
  },
})

const App = () => {
  return (
    <UIProvider config={config}>
      <YourApplication />
    </UIProvider>
  )
}