Alert

PRO

You can edit 8 Components for free. Get premium for unlimited access.

Displays a callout for user attention.

Figma

The Notification component is used to communicate news in an app or to give direct feedback.

1. Reference

This component inherits props from the Notification.

Prop
Type
Default
type
error
success
warning
info
error
close
true
false
true

2. Type

You can edit the type with the error, success, warning or info parameter.

Image 2.1 : Type error

Image 2.2 : Type info

Image 2.3 : Type warning

Image 2.4 : Type success

3. Close

You can edit the close with the true or false parameter.

Image 3.1 : Close true

Image 3.2 : Close false

Jetpack Compose

The Notification component is used to communicate news in an app or to give direct feedback.

1. Reference

This component inherits props from the Notification.

Prop
Type
Default
type
NotificationType.error
NotificationType.success
NotificationType.warning
NotificationType.info
NotificationType.error
close
.true
.false
.true
title
"text"

-

description
"text"

-

action

-

-

2. Type

You can edit the type with the NotificationType.error, NotificationType.success, NotificationType.warning or NotificationType.info parameter.

Notification
Lorem ipsum dolor sit amet, consetetur sadipscing elitr.
Notification
Lorem ipsum dolor sit amet, consetetur sadipscing elitr.
Notification
Lorem ipsum dolor sit amet, consetetur sadipscing elitr.
Notification
Lorem ipsum dolor sit amet, consetetur sadipscing elitr.
Notification(
title = "Notification",
description = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
type = NotificationType.error,
close = false,
action = {}
)

Notification(
title = "Notification",
description = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
type = NotificationType.success,
close = false,
action = {}
)

Notification(
title = "Notification",
description = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
type = NotificationType.warning,
close = false,
action = {}
)

Notification(
title = "Notification",
description = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
type = NotificationType.info,
close = false,
action = {}
)

3. Close

You can edit the close with the .true or .false parameter.

Notification
Lorem ipsum dolor sit amet, consetetur sadipscing elitr.
Notification(
title = "Notification",
description = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
type = NotificationType.info,
action = {}
)

Preview

Error alert
Something went wrong while processing your request.
const DlAlert(
  title: 'Error alert',
  description: 'Something went wrong while processing your request.',
  variant: DlAlertVariant.error,
)
Copy

Usage

Add this code example to your project to see how the component works.

DlAlert(
  title: 'title',
  description: 'description',
  variant: DlAlertVariant.info,
  onClose: () {},
  },
)
Copy

API Reference

DlAlert is a full-width alert component with token-based typography and spacing, variant-specific leading icons, and an optional dismissible close area.

Prop
Type
Default
title
String
-
description
String?
null
variant
info
success
warning
error
info
onClose
VoidCallback?
null

Examples

Error

Error alert
Something went wrong while processing your request.
const DlAlert(
  title: 'Error alert',
  description: 'Something went wrong while processing your request.',
  variant: DlAlertVariant.error,
)
Copy

Success

Success alert
Your action was completed successfully.
const DlAlert(
  title: 'Success alert',
  description: 'Your action was completed successfully.',
  variant: DlAlertVariant.success,
)
Copy

Warning

Warning alert
Please review this value before continuing.
const DlAlert(
  title: 'Warning alert',
  description: 'Please review this value before continuing.',
  variant: DlAlertVariant.warning,
)
Copy

Information

Info alert
This is an informational message.
const DlAlert(
  title: 'Info alert',
  description: 'This is an informational message.',
  variant: DlAlertVariant.info,
)
Copy

With close-icon

Dismissible alert
Click the close area on the right to hide this alert.
DlAlert(
  title: 'Dismissible alert',
  description: 'Click the close area on the right to hide this alert.',
  variant: DlAlertVariant.info,
  onClose: () {},
  },
)
Copy

Discover more content

You have questions or need help?

E-Mail

You want to try?

Test for free

Save time and money?

Get Pro Version