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

UI Component Anatomy

In this section

Overview

UI component folder structure and file names all have specific purposes. The combinations of names and file location allows us to easily automatically build the guide, understand theme support, css structure, component behavior, and guide examples.

Let's take a look at a typical guide component folder breakdown through a possible breakdown for the fictitious component <my-tabs>:

html
    /myTabs
        index.scss
        my.tabs.example.controller.js
        my.tabs.component.js
        my.tabs.module.js
        readme.md
        /snippets
            default.html
            modifier.example.html
        /theme
            index.scss

Let's discuss the purpose of each file.

html
/myTabs/index.scss

This file contains core structural CSS concerns for the my-tabs component. We would expect the contents of the file to follow BEM syntax and include the structural style under the class name of c-myTabs. See our scss writing guidelines for the appropriate class naming and css property authoring rules.

html
/myTabs/my.tabs.example.controller.js

This file contains an example controller for use within the examples found within the snippets. This file is should follow our controller naming conventions and class structure.

html
/myTabs/my.tabs.component.js

This file contains the core behavior (controller) and binding for <my-tabs>. The binding and controller should follow the standards for presentations components found on https://confluence.csgicorp.com/pages/viewpage.action?pageId=606619326

html
/myTabs/my.tabs.module.js

This file contains the angular module definition for the component. It also pulls in any angular dependencies as part of the module definition. The is the JavaScript file that is to be imported by the parent module.

html
/myTabs/readme.md

This file is the essential building block for the guide. All index.html files in the guide are generated from the readme.md files within the guide's folders.

The readme markdown files can contain any free markdown documentation that makes sense for a component. The files also contain YAML based front-matter, which the guide builder will use to pull in a few typical pieces of information. For example, our guide markdown for the my-tabs component may look something like this:

markdown
    ---
    title: My Tabs
    description: Short description of the overall component.
    variants:
    -
        name: Typical Usage
        description: A description about the typical/default use of my tabs
        snippet: ./snippets/default.html
    -
        name: Modifier
        description: A description about some modifier use of my tabs
        snippet: ./snippets/modifier.example.html
    ---
    ## Some extra markdown based documentation about my-tabs here!
html
/snippets/[snippet name].html

These snippet files are the example files that the guide uses to build the living + automatically documented markup. Use your example controllers and mock data within them to showcase the components states, mofidiers, and functionality. You can add any number of example variants that make sense for your component.

html
/theme/index.scss

This file is typically imported at the end of the index.scss file at the root of the component. It contains any themeable area support, including brand and content themeable area themeing. Older version of the theme folder may have the themes broken into discretely separate files (i.e. _brand.scss and _content.scss), but this is no longer required.

html
Brand theme in /theme/index.scss

This is where we define any theme that is using the brand color, which changes depending upon the application module. The brandStyling mixin will add the appropriate theme classes (i.e. t-reporting, t-care, etc) for you. You will also have access to a $brandColor variable. The css written in this file is replicated per applicaton module - therefore, it is important to only define properties in this file that need to use brandColor.

As an example, we may define the following css within theme/index.scss:

scss
@include brandStyling() {
    .c-content {
        .c-myTabs {
            .c-myTabs-title {
                color: $brandColor;
            }
        }    
    }
}
html
Content theme in /theme/index.scss

Here we define all of our neutral styling that goes within the t-content theme-able area. The contentThemeStyling mixin is available to add the appropriate theme-able area classes above your descendent selectors.

Our my-tabs content theme may look something like this:

scss
    @include contentThemeStyling() {
        .c-myTabs {
            .c-myTabs-title {
                border-color: palette(invison, border_medium);
            }
        }
    }

File Naming

The ui guide naming standard may largely appear mixed. This is because the ui guide started with a camelCase file naming standard, but most other Invision projects used the . between standard. Please adhere to the project-wide . standard for file names moving forward.

Good:

html
sample.snippet.html

Bad:

html
sampleSnippet.html

This is required for new files, and recommended for files you may be editing as part of a pr. Please use git mv to actually move files to the new name to preserve the git history on the file.