Labels are useful inline styles that can be dropped into body copy to call out certain sections or to attach metadata. Examples might be noting when something was updated or that something is new.

Regular Label
Radius Secondary Label
Round Alert Label
Success Label

Build With Predefined HTML Classes

There are two ways to build labels in Foundation 4: with our predefined HTML classes or with our mixins. Building labels using our predefined classes is simple, you'll just need to write a <span class="label"> and apply the classes you want.

<span class="label">Regular Label</span>
<span class="radius secondary label">Radius Secondary Label</span>
<span class="round alert label">Round Alert Label</span>
<span class="success label">Success Label</span>

The class options:

  • The color classes include: .secondary, .alert or .success
  • The radius classes include: .radius or .round.

For these styles to come across, make sure you have the default Foundation CSS package or that you've selected labels from a custom package. These should be linked up following our default HTML page structure.

Build With Our Mixins

We've included SCSS mixins used to style labels. To use the mixin, you'll need to have the extension installed or grab _variables.scss, _global.scss and _labels.scss from Github and throw them into a Foundation folder in your project directory. From there, you can import the files at the top of your own SCSS stylesheet, like so:

@import "foundation/variables";
@import "foundation/components/global";
@import "foundation/components/labels";
Quick Mixin

You can build your labels using our global mixin by including it on your custom class or ID in your own stylesheet. The mixin contains options for changing the background color, which also controls the border and text color. You'll also have the ability to change the font-size and padding. The rest of the defaults can be modified using the available variables. The global mixin looks like this:

/* Using the default styles */
.your-class-name { @include label; }

There are also four options you can customize on the fly when writing this mixin. These control things like: padding, text size, background color and radius. Setting any of these options to false will negate those styles.

/* Using the available options */
.your-class-name { @include label($padding,$text-size,$bg,$radius); }

/* Controls the padding, set to a string following top, right, bottom, left rules or change the variable */
$padding: $label-padding

/* Control your text-size per label */
$text-size: $label-font-size

/* Change the background color for your labels */
$bg: $primary-color

/* Control how much radius is put on the labels */
$radius: false

Here's an example of a custom label style.

Default SCSS Variables
$include-html-label-classes: $include-html-classes;

/* We use these to style the labels */
$label-padding: em-calc(3 10 4);
$label-radius: $global-radius;

/* We use these to style the label text */
$label-font-sizing: em-calc(14);
$label-font-weight: bold;
$label-font-color: #333;
$label-font-color-alt: #fff;

Note: em-calc(); is a function we wrote to convert px to em. It is included in _variables.scss.

This is a modal.

Reveal makes these very easy to summon and dismiss. The close button is simply an anchor with a unicode character icon and a class of close-reveal-modal. Clicking anywhere outside the modal will also dismiss it.

Finally, if your modal summons another Reveal modal, the plugin will handle that for you gracefully.

Second Modal...


This is a second modal.

See? It just slides into place after the other first modal. Very handy when you need subsequent dialogs, or when a modal option impacts or requires another decision.


This modal has video