Callout

Callouts provide presentation of content in a visually distinct manner. Includes a heading, icon and typically text-based content.

Other frameworks

CoreUI components are available as native Angular, React, and Vue components. To learn more please visit the following pages.

Examples

Callout component is prepared for any length of text, as well as an optional elements like icons, headings, etc. For a styling, use one of the required contextual classes (e.g., .callout-success).

New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, terminology, guidelines, and code snippets.
New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, terminology, guidelines, and code snippets.
New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, terminology, guidelines, and code snippets.
New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, terminology, guidelines, and code snippets.
New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, terminology, guidelines, and code snippets.
New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, terminology, guidelines, and code snippets.
New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, terminology, guidelines, and code snippets.
New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, terminology, guidelines, and code snippets.
html
<div class="callout callout-primary">
  New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, terminology, guidelines, and code snippets.
</div>
<div class="callout callout-secondary">
  New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, terminology, guidelines, and code snippets.
</div>
<div class="callout callout-success">
  New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, terminology, guidelines, and code snippets.
</div>
<div class="callout callout-danger">
  New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, terminology, guidelines, and code snippets.
</div>
<div class="callout callout-warning">
  New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, terminology, guidelines, and code snippets.
</div>
<div class="callout callout-info">
  New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, terminology, guidelines, and code snippets.
</div>
<div class="callout callout-light">
  New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, terminology, guidelines, and code snippets.
</div>
<div class="callout callout-dark">
  New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, terminology, guidelines, and code snippets.
</div>

Conveying meaning to assistive technologies

Using color to add meaning only provides a visual indication, which will not be conveyed to users of assistive technologies – such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (e.g. the visible text), or is included through alternative means, such as additional text hidden with the .visually-hidden class.

Customizing

CSS variables

Callouts use local CSS variables on .callout for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too.

--#{$prefix}callout-padding-x: #{$callout-padding-x};
--#{$prefix}callout-padding-y: #{$callout-padding-y};
--#{$prefix}callout-margin-x: #{$callout-margin-x};
--#{$prefix}callout-margin-y: #{$callout-margin-y};
--#{$prefix}callout-border-width: #{$callout-border-width};
--#{$prefix}callout-border-color: #{$callout-border-color};
--#{$prefix}callout-border-left-width: #{$callout-border-left-width};
--#{$prefix}callout-border-radius: #{$callout-border-radius};

SASS variables

$callout-padding-y:                 $spacer;
$callout-padding-x:                 $spacer;
$callout-margin-y:                  $spacer;
$callout-margin-x:                  0;
$callout-border-radius:             var(--#{$prefix}border-radius);
$callout-border-width:              var(--#{$prefix}border-width);
$callout-border-color:              var(--#{$prefix}border-color);
$callout-border-left-width:         calc(#{$callout-border-width} * 4); // stylelint-disable-line function-disallowed-list

$callout-variants: (
  "primary":    $primary,
  "secondary":  $secondary,
  "success":    $success,
  "danger":     $danger,
  "warning":    $warning,
  "info":       $info,
  "light":      $light,
  "dark":       $dark
);

Variants

Check out our Sass maps and loops docs for how to customize these loops and extend CoreUI’s base-modifier approach to your own code.

Modifiers

CoreUI’s callout component is built with a base-modifier class approach. This means the bulk of the styling is contained to a base class .callout while style variations are confined to modifier classes (e.g., .callout-danger). These modifier classes are built from the $callout-variants map to make customizing the number and name of our modifier classes.

// Generate contextual modifier classes for colorizing the collor.
@each $state, $value in $callout-variants {
  .callout-#{$state} {
    --#{$prefix}callout-border-left-color: #{$value};
  }
}