Color Generator

Generate and export Tailwind color patterns.

Brand Colors

primary
secondary

State Colors

info
success
warning
error

Color Picker

Alert

Detailed documentation for the Alert component in the PixelBlockUI library.

The Alert component is used to display important messages to the user. It supports various types of alerts such as success, error, warning, and info, each with a corresponding icon and color scheme.

Installation

You can install the Alert component using the PixelBlock CLI tool.

npx pixelblock-cli add Alert

Usage

Basic Usage

Alert with Custom Icon

You can customize the icon for each alert type by passing a React node as the icon prop.

Props

Alert Props

The Alert component accepts the following props:

PropTypeDescription
type'success' | 'error' | 'warning' | 'info'The type of alert to display.
titlestringThe title of the alert.
descriptionstringThe description or message of the alert.
iconReact.ReactNodeOptional icon to display in the alert.
onClose() => voidOptional callback function to handle close action.

Conclusion

The Alert component is a versatile and customizable way to display important messages to users. With support for different alert types and custom icons, it can be easily integrated into any React or Next.js project.

For more information and detailed usage instructions, refer to the PixelBlockUI Documentation.