Invision UI v.19.6.0-0

Getting Started

  • Running Invision UI
  • UI Component Anatomy
  • Authoring SCSS
  • Authoring Presentational Behavior

Component Foundations

  • SCSS Authoring
    • Mixins & Variables
    • Stateful Classes
  • State Guidance
    • Empty/Zero State
    • Loading State
  • Utilities
    • Align
    • Display
    • Flexbox
    • Font Size
    • Layout
    • Offset
    • Position
    • Overflow
    • Size
    • Spacing
    • Text
  • Layout
    • Arrange [Deprectated]
    • Divided Columns
    • Embed Video
    • Full and Center
    • Fill [Deprectated]
    • Grid
    • Media Blocks
    • Panels
    • Vertical Layouts
  • Media Queries
  • Angular Behaviors
    • App Theme Directive
    • Auto Focus Input
    • Filters
    • Popup (modal dialog) Manager
    • Tether (tooltip/dropdown) Manager
    • Resize Sensor
    • Watchers

UI Component Library

  • Content & Containment
    • Active Translation
    • Auto Fit Text
    • Address
    • Basic & Input Table
    • Brand Logo/Slogan
    • Call to Action - Empty State
    • Carousel
    • Cart
    • Choice
    • Collapsible Container
    • Copyright Footer
    • Coupon Redeemer
    • Content
    • Date Relative Display
    • Definition Lists
    • Delimited List
    • Details
    • Expiration Date Display
    • Feature Toggle
    • Form Section Heading
    • Header
    • Heading
    • Heading With Annotation
    • Icons
    • Interaction Details
    • Labeled Balance
    • Link
    • Main Container
    • Metadata Card
    • Metadata List Item
    • Offering QuickView
    • Payment Instrument
    • Preference Dialog
    • Pricing Plan Decoration
    • Product Availability
    • Product Details
    • Product Image
    • Quick Info Panel
    • Remark
    • Renewal Column
    • Richlist Filterbar
    • Richlist Wrapper
    • Scrollable Horizontal List
    • Search Card
    • Search Panel
    • Section
    • Selectable Option
    • Smart Truncate
    • Status Grid
    • Tooltip
  • Data Visualizations
    • Bill Runs
    • Comparison Table
    • Datatable
    • Progress Tracker
    • Schedules
    • Query Builder
  • Dialogs
    • Confirmation Dialog
    • Dialog
    • Rich List Dialog
    • Wait Dialog
  • Forms and Filters
    • Additional Properties
    • Autocomplete
    • 3 Field Date Input
    • Checkbox
    • Credit Card
    • Bulk Action Bar
    • Buttons
    • Confirmation Button
    • Date Picker
    • E-Check
    • Entity Specification
    • External Bill
    • External Gift Card
    • Focus Group
    • Forms
    • Filter Bar
    • Filter Dropdowns
    • Gift Card
    • Grouped Check Filters
    • Inputs
    • Input Select Combo
    • Monetary Input
    • Multi Dropdown Selector
    • Multiple Numeric Input
    • Monetary Range Input
    • Password Unmask Button
    • Select
    • Select Button Or Stepper
    • Select Or Text Input
    • Stepper
    • Tag Dropdown
  • Navigation & Flow
    • Back Banner
    • Back Component
    • Breadcrumbs
    • Details Pager
    • Expandable Section
    • Infinite Scroll
    • Open New Window
    • Pager
    • Fancy Richlist
    • Standard Navigator
    • Status Indicator
    • Step Progress Bar
    • Step Progress Indicator
    • Tab Card
    • Tab Panel
    • Tier Navigator
    • Wizard
  • Notifications
    • Loading Indicator
    • Toast Notifications
  • Deprecated
    • Content Area

Showcase

  • General
    • Simplelist
    • Richlist
    • Primary (side) Navigator
  • Customer Care
    • Case Activity List
    • Customer Care Navigator Component
    • Dashboard
    • Decisions
  • Reporting
    • Content Visualization

Unit Testing

  • Actions
  • Components
  • Selectors
  • Reducers

End-to-end Testing

Statistics

Flexbox

In this section

Overview Variants
  • Utils-Flexbox - Basic container layout
  • Utils-Flexbox - Reverse direction in container
  • Utils-Flexbox - Justify/Space items along the main X-axis
  • Utils-Flexbox - Align items along the cross Y-axis
  • Utils-Flexbox - Grow, Shrink
  • Utils-Flexbox - Basis Zero
  • Utils-Flexbox - Grow, Srhink
  • Utils-Flexbox - Keep width and height
  • Utils-Flexbox - Self Alignment
  • Utils-Flexbox - Item Order
  • Utils-Flexbox - Item Porportional Sizing

Utilities for using flexbox. These are single-purpose classes aimed to help module layout concerns. Can also use it as trumps for overwrites. It is not ideal to use this utility set to layout everything in your app. Use hammock-components-flexbox for components and page/app layouts.

Utils-Flexbox - Basic container layout

Utilities for using flexbox. Sets up the flexbox container and how items inside flow.

Flex default, flow in a row. Same as using class="u-flexInline which ensures inline-level flex display.
1
2
3
4
Flex items in a column
1
2
3
4
Flex items in a row
1
2
3
4
Flex items wrap to container width
1
2
3
4
Flex items don't wrap
1
2
3
4
HTML
<style>
    .Test-area {
        width: 300px;
        border: 1px solid black;
    }
    .Test-area-2 {
        height: 100px;
        border: 1px solid black;
    }
    .Test-area > div, .Test-box {
        background-color: green;
        color: white;
        width: 100px;
        height: 50px;
        margin: .2em;
    }
    .Test-box-fixed-width {
        min-width: 100px;
    }
    .Test-inner {
        background-color: green;
        color: white;
        border: 1px solid cyan;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .Test-overflow, .Test-overflow .Test-inner {
        overflow:hidden;
    }
</style>

<div>Flex default, flow in a row. Same as using <code>class="u-flexInline</code> which ensures inline-level flex display.</div>
<div class="u-flex Test-area">
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
</div>

<div>Flex items in a column</div>
<div class="u-flex u-flexColumn Test-area">
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
</div>

<div>Flex items in a row</div>
<div class="u-flex u-flexRow Test-area">
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
</div>

<div>Flex items wrap to container width</div>
<div class="u-flex u-flexWrap Test-area">
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
</div>

<div>Flex items don't wrap</div>
<div class="u-flex u-flexNowrap Test-area">
  <div class="Test-box-fixed-width">1</div>
  <div class="Test-box-fixed-width">2</div>
  <div class="Test-box-fixed-width">3</div>
  <div class="Test-box-fixed-width">4</div>
</div>

Utils-Flexbox - Reverse direction in container

Flow items in the reversed order on x- or y-axis

Flex items in a column in reversed order
1
2
3
4
Flex items in a row in reversed order
1
2
3
4
Flex items in reversed order and wrap to container width
1
2
3
4
HTML
<div>Flex items in a column in reversed order</div>
<div class="u-flex u-flexColumnReverse Test-area">
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
</div>
<div>Flex items in a row in reversed order</div>
<div class="u-flex u-flexRowReverse Test-area">
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
</div>
<div>Flex items in reversed order and wrap to container width</div>
<div class="u-flex u-flexWrapReverse Test-area">
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
</div>

Utils-Flexbox - Justify/Space items along the main X-axis

Control spacing of items on the X-axis

Space items evenly or justified on x-axis
1
2
3
Space items evenly but with equal space around it
1
2
3
Center items on the x-axis
1
2
3
Item flow begins at the start of x-axis. This is the default behavior for flex container items.
1
2
3
Item flow begins at the end of x-axis.
1
2
3
HTML
<div>Space items evenly or justified on x-axis</div>
<div class="u-flex u-flexSpaced" style="border:1px solid black">
  <div class="Test-box">1</div>
  <div class="Test-box">2</div>
  <div class="Test-box">3</div>
</div>

<div>Space items evenly but with equal space around it</div>
<div class="u-flex u-flexSpacedAround" style="border:1px solid black">
  <div class="Test-box">1</div>
  <div class="Test-box">2</div>
  <div class="Test-box">3</div>
</div>

<div>Center items on the x-axis</div>
<div class="u-flex u-flexCentered" style="border:1px solid black">
  <div class="Test-box">1</div>
  <div class="Test-box">2</div>
  <div class="Test-box">3</div>
</div>

<div>Item flow begins at the start of x-axis. This is the default behavior for flex container items.</div>
<div class="u-flex u-flexStart" style="border:1px solid black">
  <div class="Test-box">1</div>
  <div class="Test-box">2</div>
  <div class="Test-box">3</div>
</div>

<div>Item flow begins at the end of x-axis.</div>
<div class="u-flex u-flexEnd" style="border:1px solid black">
  <div class="Test-box">1</div>
  <div class="Test-box">2</div>
  <div class="Test-box">3</div>
</div>

Utils-Flexbox - Align items along the cross Y-axis

Control spacing and positioining of items on the Y-axis

Items are stretched to fill the container across the Y-axis. This is default flexbox behavior, repects height value.
1
2
3
Align items in the middle of the y-axis
1
2
3
Items are aligned along their baselines
1
2
3
Item flow begins at the start/top of y-axis.
1
2
3
Item flow begins at the end (bottom) of y-axis.
1
2
3
HTML
<div>Items are stretched to fill the container across the Y-axis. This is default flexbox behavior, repects height value.</div>
<div class="u-flex u-flexStretch Test-area-2">
  <div style="background: green; width: 50px">1</div>
  <div style="background: green;  width: 50px">2</div>
  <div style="background: green; width: 50px;">3</div>
</div>
<div>Align items in the middle of the y-axis</div>
<div class="u-flex u-flexMiddle Test-area-2">
  <div class="Test-box" style="height: 80px">1</div>
  <div class="Test-box" style="height: 30px">2</div>
  <div class="Test-box">3</div>
</div>
<div>Items are aligned along their baselines</div>
<div class="u-flex u-flexBaseline Test-area-2">
  <div class="Test-box" style="height: 80px; padding: 1em">1</div>
  <div class="Test-box" style="height: 30px">2</div>
  <div class="Test-box">3</div>
</div>
<div>Item flow begins at the start/top of y-axis.</div>
<div class="u-flex u-flexTop Test-area-2">
  <div class="Test-box" style="height: 80px; padding: 1em">1</div>
  <div class="Test-box" style="height: 30px">2</div>
  <div class="Test-box">3</div>
</div>
<div>Item flow begins at the end (bottom) of y-axis.</div>
<div class="u-flex u-flexBottom Test-area-2">
  <div class="Test-box" style="height: 80px">1</div>
  <div class="Test-box" style="height: 30px">2</div>
  <div class="Test-box">3</div>
</div>

Utils-Flexbox - Grow, Shrink

Grow or shrink

Grow items to fit the container in height and width
1 2
Shrink items to fit the container in height and width
1 2
HTML
<div>Grow items to fit the container in height and width</div>
<div class="u-flex" style="height:50px; width:500px">
  <span class="u-flexItemGrow Test-inner" style="width: 100px">1</span>
  <span class="u-flexItemGrow Test-inner" style="width: 100px">2</span>
</div>
<div>Shrink items to fit the container in height and width</div>
<div class="u-flex" style="height:50px; width:500px">
  <span class="u-flexItemShrink Test-inner" style="width: 800px">1</span>
  <span class="u-flexItemShrink Test-inner" style="width: 800px">2</span>
</div>

Utils-Flexbox - Basis Zero

Set the initial main size of a flex element to 0, primarily used to resolve IE flex issues;

This is just an example of this utility being used, will come back to put in a broken & working example
1
HTML
<div>This is just an example of this utility being used, will come back to put in a broken & working example</div>
<div class="u-flex u-flexColumn" style="height:50px; width:500px">
    <span class="u-flexItemGrow u-flexBaseZero Test-inner" style="width: 100px">1</span>
</div>

Utils-Flexbox - Grow, Srhink

Test bug fix to address overflow flexbox items in chrome browser;

1 let's add some texts to test test this issue 2 Test box
1 let's add some texts to test test this issue 2 Test box
HTML
<div class="u-flex Test-overflow" style="height:20px; width:200px">
  <span class="u-flexItemGrow Test-inner">1 let's add some texts to test test this issue</span>
  <span class="Test-inner">2 Test box</span>
</div>
<div class="u-flex u-flexColumn Test-overflow" style="height:50px; width:50px">
  <span class="u-flexItemGrow Test-inner">1 let's add some texts to test test this issue</span>
  <span class="Test-inner">2 Test box</span>
</div>

Utils-Flexbox - Keep width and height

preserve the width and height of the element itself, no grow or shrink

Not shrinking width of item
1
maintain height of the element to the container in height and width
1
HTML
<div>Not shrinking width of item</div>
<div class="u-flex" style="height:50px; width:500px">
  <span class="u-flexItemNoShrink Test-inner" style="width: 800px;">1</span>
</div>
<div>maintain height of the element to the container in height and width</div>
<div class="u-flex" style="height:60px; width:500px;">
  <span class="u-flexKeepHeight Test-inner">1</span>
</div>

Utils-Flexbox - Self Alignment

Specify individual item's alignment overriding one defined on the container. Float, clear and vertical-align are ignored on flex items.

1 Middle
2 Baseline
3 Bottom
4 Top
1
2
3
4
HTML
<div class="u-flex Test-area-2">
  <div class="Test-box u-flexItemBaseline" style="height: 80px">1 Middle</div>
  <div class="Test-box u-flexItemMiddle" style="height: 30px">2 Baseline</div>
  <div class="Test-box u-flexItemBottom">3 Bottom</div>
  <div class="Test-box u-flexItemTop">4 Top</div>
</div>
<div class="u-flex Test-area-2">
  <div class="u-flexItemStretch Test-box">1</div>
  <div class="u-flexItemStretch Test-box">2</div>
  <div class="u-flexItemStretch Test-box">3</div>
  <div class="u-flexItemStretch Test-box">4</div>
</div>

Utils-Flexbox - Item Order

Force move an item to be the first or last in a container

1
2
3 (force to first)
4
1
2 (force to last)
3
4
HTML
<div class="u-flex Test-area-2">
  <div class="Test-box">1</div>
  <div class="Test-box">2</div>
  <div class="Test-box u-flexItemFirst">3 (force to first)</div>
  <div class="Test-box">4</div>
</div>
<div class="u-flex Test-area-2">
  <div class="Test-box">1</div>
  <div class="Test-box u-flexItemLast">2 (force to last)</div>
  <div class="Test-box">3</div>
  <div class="Test-box">4</div>
</div>

Utils-Flexbox - Item Porportional Sizing

Relative sizing of items in container

1
2
3
1
2
3
4
5
HTML
<div class="u-flex Test-area-2">
  <div class="Test-inner u-flexItemSized">1</div>
  <div class="Test-inner u-flexItemSized+">2</div>
  <div class="Test-inner u-flexItemSized++">3</div>
</div>
<div class="u-flex Test-area-2">
  <div class="Test-box u-flexItemSized">1</div>
  <div class="Test-box u-flexItemSized+">2</div>
  <div class="Test-box u-flexItemSized++">3</div>
  <div class="Test-box u-flexItemSized">4</div>
  <div class="Test-box u-flexItemSized++">5</div>
</div>