Skip to content
Indiana University Logo
Rivet Design System
  • Components Add-ons Content guide Migration guide
  • What is Rivet? Blog Changelog
  1. May 4, 2022

    Rivet 2.0.0-beta.4 release

    The fourth Rivet 2 beta release introduces design updates to several components and a new responsive table wrapper element.

  2. March 30, 2022

    Rivet 2.0.0-beta.3 release

    The third Rivet 2 beta release updates accordion, badge, and button styles.

  3. February 9, 2022

    Rivet 2.0.0-beta.2 release

    The latest Rivet 2 beta release introduces the link hub component, adds new utility classes, and refactors component JavaScript.

More posts Get updates in your inbox
Install via NPM Download CSS & JS Hosted assets
Navigation
    • Components
    • Add-ons
    • Content guide
    • What is Rivet?
    • Blog
    • Roadmap
    • Changelog
  • Use Rivet
Resources
  • User Experience Office
  • Accessibility Evaluations
  • Rivet Software Design System
  • IU Framework for WCMS
Rivet 1 is deprecated. Please use Rivet 2 instead.
Version 1.8.3
  • Information
    • Changelog
    • Component status
    • Contributing
  • Getting started
    • Install with NPM
    • Rivet Sass
  • Layout
    • Box
    • Grid
    • Panels
    • Spacing
    • Typography
  • Page content
    • Badges
    • Links
    • Lists
    • Media Object
    • Step Indicator
    • Tables
    • Tabs This component requires JS
    • Timeline
  • Forms
    • Buttons
    • Segmented Buttons
    • Checkboxes
    • File input This component requires JS
    • Input group
    • Radio buttons
    • Select element
    • Text inputs
  • Navigation
    • Breadcrumb
    • Dropdown This component requires JS
    • Footer
    • Header This component requires JS
    • Menu
    • Pagination
  • Overlays & Feedback
    • Alerts This component requires JS
    • Loading indicator
    • Modals This component requires JS
  • Utilities
    • Border
    • Display
    • Flex
    • Text
    • Visibility
    • Width
    • z-index
Ready Added in 1.3.0

Flex

This set of responsive flexbox utilities can help you fine-tune layouts based on different screen sizes.

Migrating to Rivet 2

This version of Rivet is deprecated. View the flex utilities documentation on the Rivet 2 website.

Flex utilities example

The Rivet flexbox utilities provide a robust set of CSS classes you can use to lay out items in a container. These utilities take advantage of CSS flexbox and are designed to be used when fine-tuning the layout of items at the individual component level.

The flex utilities are not intended for page layout. You should use the Rivet grid system for page layout.

Item one
Item two
Item three
Item four
Item five
<div class="rvt-flex rvt-wrap">
  <div class="rvt-bg-blue rvt-m-right-sm">Item one</div>
  <div class="rvt-bg-blue rvt-m-right-sm">Item two</div>
  <div class="rvt-grow-1 rvt-bg-blue rvt-m-right-sm">Item three</div>
  <div class="rvt-bg-blue rvt-m-right-sm">Item four</div>
  <div class="rvt-bg-blue rvt-m-right-sm">Item five</div>
</div>

Available flex utilities

The flex utilities come with CSS classes for most flex properties, but not all.

Because we have designed these utilities to be generic, we have intentionally left out flex properties that require specific knowledge of how many items live in a given flex container (e.g. order), as we’d be unable to create utility classes that would cover every likely combination. We’ve left out properties that set the widths of flex children (e.g. flex-basis) for similar reasons.

Help with flexbox

The specifics of how the various flexbox properties work is beyond the scope of this documentation. If you need help with flexbox, we recommend checking out this Complete Guide to Flexbox on CSS-Tricks.

Responsive flex utilities

All of the flex utilities have responsive variants that correspond to Rivet’s standard breakpoints. Adding the breakpoint suffix -<breakpoint name>-up will cause the flex utility to start working at that breakpoint screen size and larger, similar to how Rivet’s spacing and typography classes work.

Item one
Item two
Item three
<div class="rvt-flex-md-up rvt-justify-space-between-lg-up">
  <div class="rvt-bg-blue rvt-m-right-sm-md-up">Item one</div>
  <div class="rvt-bg-blue rvt-m-right-sm-md-up">Item two</div>
  <div class="rvt-bg-blue rvt-m-right-sm-md-up">Item three</div>
</div>

Flex container utilities

A flex container is generally the parent element to which you would apply the display: flex; property. The flex utilities have CSS classes for most of the flex container properties available in the flexbox model.

The following flex container CSS utility classes are available:

flex, flex-direction, and flex-wrap

See the documentation on the Mozilla Developer Network (MDN) for more information about the flex, flex-direction, and flex-wrap properties.

  • .rvt-flex
  • .rvt-inline-flex
  • .rvt-row
  • .rvt-row-reverse
  • .rvt-column
  • .rvt-column-reverse
  • .rvt-wrap
  • .rvt-no-wrap
  • .rvt-wrap-reverse

justify-content

See the documentation on MDN for more information about the justify-content property.

  • .rvt-justify-start
  • .rvt-justify-end
  • .rvt-justify-center
  • .rvt-justify-space-between
  • .rvt-justify-space-around
  • .rvt-justify-space-evenly

align-content

See the documentation on MDN for more information about the align-content property.

  • .rvt-content-start
  • .rvt-content-end
  • .rvt-content-center
  • .rvt-content-stretch
  • .rvt-content-baseline

align-items

See the documentation on MDN for more information about the align-items property.

  • .rvt-items-start
  • .rvt-items-end
  • .rvt-items-center
  • .rvt-items-stretch
  • .rvt-items-baseline

Flex item utilities

A flex item is generally the direct child of any flex container. The flex utilities have CSS classes for most of the flex item properties in the flexbox model.

The following flex item CSS utility classes are available:

flex-shrink and flex-grow

See the documentation on MDN for more information about the flex-shrink and flex-grow properties.

  • .rvt-shrink-1
  • .rvt-shrink-0
  • .rvt-grow-1
  • .rvt-grow-0

align-self

See the documentation on MDN for more information about the align-self property.

  • .rvt-self-start
  • .rvt-self-end
  • .rvt-center-end
  • .rvt-stretch-end
  • .rvt-baseline-end

On this page

    • Flex utilities example
    • Available flex utilities
      • Responsive flex utilities
      • Flex container utilities
        • flex, flex-direction, and flex-wrap
        • justify-content
        • align-content
        • align-items
      • Flex item utilities
        • flex-shrink and flex-grow
        • align-self
  • Accessibility
  • Privacy Notice
  • Copyright © The Trustees of Indiana University