Alert

import Alert from 'frui/Alert';
Copy

Props

NameTypeRequiredNotes
classNamestringNoStandard HTML class names
colorstringNoCustom CSS hex or name
curvedbooleanNoSlight curved corners
errorbooleanNoRed alert
infobooleanNoBlue alert
mutedbooleanNoGray alert
outlinebooleanNoBorder and text with color
pillbooleanNoMax rounded corners
roundedbooleanNoRounded corners
solidbooleanNoFills alert with color
styleCSS ObjectNoStandard CSS input
successbooleanNoGreen alert
warningbooleanNoOrange alert

Types

Alerts have the following types: info, warning, success, error, and muted.

No results found
<Alert info className="flex items-center">
  <i className="fas fa-info-circle mr-2"></i>
  No results found
</Alert>
Copy
Are you sure ?
<Alert warning className="flex items-center">
  <i className="fas fa-exclamation-triangle mr-2"></i>
  Are you sure ?
</Alert>
Copy
Successfully saved !
<Alert success className="flex items-center">
  <i className="fas fa-check-circle mr-2"></i>
  Successfully saved !
</Alert>
Copy
Could not save
<Alert error className="flex items-center">
  <i className="fas fa-exclamation-circle mr-2"></i>
  Could not save
</Alert>
Copy
I am disabled
<Alert muted className="flex items-center">
  I am disabled
</Alert>
Copy

Custom Color

Alerts can have custom CSS compatible colors which includes hex and color names.

Who likes salmon?
<Alert color="salmon" className="flex items-center">
  <i className="fas fa-info-circle mr-2"></i>
  Who likes salmon?
</Alert>
Copy

Rounded

Alerts can be rounded in three ways: curved, rounded, and pill.

No results found
<Alert info curved className="flex items-center">
  <i className="fas fa-info-circle mr-2"></i>
  No results found
</Alert>
Copy
Are you sure ?
<Alert warning rounded className="flex items-center">
  <i className="fas fa-exclamation-triangle mr-2"></i>
  Are you sure ?
</Alert>
Copy
Successfully saved !
<Alert success pill className="flex items-center">
  <i className="fas fa-check-circle mr-2"></i>
  Successfully saved !
</Alert>
Copy

Custom Styles

You can add your own custom class to the alert component or use the frui-alert CSS class.