UI Components Framework Guide
This guide covers the UI components that are used across the new MSDN/TechNet technical documentation experiences for conceptual, reference, and hub pages.
Important
While this document attempts to be comprehensive in representing the UI components, it is ultimately a guide. Developers utilizing the front end code represented here should take full ownership and responsibility of it. Code is always work-in-progress, and this code is no different.
A Note on Accessibility
The components as well as the frame for conceptual, reference, and hub pages have been designed with accessibility in mind. The designs and front end markup employ many best practices like semantic markup, color contrast, proportional sizing units to support zooming, etc. to provide a solid foundation for building a very accessible platform
That said, the example mark up files as well as the code snippets for all the components are being provided stripped of ARIA roles, alt titles, etc. to avoid confusion. We recommend that the team prioritize a sprint prior to launch that focuses on updating the master templates and markdown extensions for components with all the necessary accessibility features.
Tip
A good starting point for information about accessibility is Foundation’s Accessibility Guidelines page.
Icon Fonts
The framework provides a custom icon font that includes twenty four icons. The font was generated from Microsoft's internal icon font repository. These icons can be used anywhere, but are typically used next to buttons or to provide some style and visual cues after links.
Preview
- Assembly
- Inheritance
- Cloud
- Edit
- Share
- Options
- Help
- Comments
- Feedback
- Connect
- Check Box
- Alert - Warning
- Alert - Tip
- Alert - Important
- Alert - Note
- Theme - Both
- Theme - Night
- Theme - Day
- Next
- Previous
- Up Arrow
- Down Arrow
Code
Headings
UICF provides default styles for six levels of headings. Heading level 1 <h1>
should be reserved for page titles, i.e. authors should not use level 1 headings within document bodies.
Preview
h1. Heading Level 1
h2. Heading Level 2
h3. Heading Level 3
h4. Heading Level 4
h5. Heading Level 5
h6. Heading Level 6
Code
Horizontal Rule
The horizontal rule may be used to add a horizontal line wherever needed.
Tip
Don't use the horizontal rule :) Chances are that if you feel like you need it, you really need to solve a deeper design/layout problem.
Preview
Code
Paragraphs & Inline Styles
This is a paragraph. UICF provides sensible margin and padding defaults for paragraphs. You can do all sorts of stuff within body text. For instance, you can make something strong. Or emphasize it. If you must, you can even strongly emphasize it. Worst-case: you can strikeout your outburst and pretend like you didn't just lose it.
Preview
So, I heard you like paragraphs. Especially ones with a strong personality, a flair for emphasizing syllables, and the unfortunate need to correct their mistakes.
Code
Special Inline Styles
In addition to the default inline markdown styles, UICF also provides some special styles to call out Product UI text (e.g. menus). For example, you can instruct a reader to click File > Exit if they find themselves yawning. On the other hand, you can wake a user up by hitting them with an inline code sample in Lisp like (print "Hello World")
. Didn't work? Shake it up by using some superscript and subscript.
Preview
If at first you can't File > Exit, try
try again.
Code
Links
We provide a simple and consistent experience for links. You can hyperlink pretty much anything you'd like, but it's best to use links on body text.
Preview
One fish. Two fish. Red fish. Blue fish.
Code
Buttons
UICF provides button styling that is consistent with link styling: they share the same color, hover animations, etc.
The preferred markup for buttons is the <button>
tag. However, you may also use the <a>
tag to create buttons. It's eventually a question of semantics (i.e. is this thing I'm creating a button, or a link that looks button-like?)
Preview
This is a small button:
This is a default button:
This is a big button:
This is a big, disabled button:
This is a big button with an icon (don't forget to leave a space after the icon):
Tip
You can add an icon to any button using an icon font class. UICF provides a custom icon font (generated from Microsoft's internal icon font library) with 24 individual glyphs. It is recommended that this icon font be expanded whenever icons need to be added so as to ensure that only a single request is made to download icons.
Code
Definitions
Definitions are a very lightweight way to provide short defintions for words and phrases.
Note
The defintion component is a first pass at a tooltip component. A proper tooltip component would be fairly more complex as it'd require JavaScript and a thoughtful responsive design that accounts for touch interfaces and mobile viewport sizes. It should be prioritized appropriately as UICF evolves.
Preview
Hover over this for the definition of the word definition.
Code
Lists
We provide default styles for ordered and unordered lists, and also allow for unordered and ordered lists to be nested within each other.
Preview
Lists can be ordered:
- Hey diddle diddle,
- The cat and the fiddle
- The...
- Cow
- Jumped over
- The
- Moon.
Lists can also be unordered:
- The little dog laughed,
- To see such fun.
- And the...
- Dish
- Ran away
- With the
- Spoon
Lists can also be mixed:
- Baa, baa, black sheep,
- Have you any wool?
- Yes, sir, yes, sir,
- Three bags full:
- One for the master,
- And one for the dame,
- And one for the little boy
- Who lives down the lane.
Code
Blockquotes
Blockquotes may be used to quote blocks of content from other sources within your document.
Preview
Unless someone like you
Cares a whole awful lot,
Nothing is going to get better.
It’s not.
Code
Footnotes
Footnotes are notes that may be placed at the bottom of the page (or below tables and other figures). They comment on a designated part of the text above it.
Alerts
Alerts are stylized UI blocks that draw the reader's attention to the content they contain. Content within alerts may contain paragraphs, lists, and inline styles, but authors should try to keep alerts brief and use them sparingly.
In all, we provide five kinds of alerts, but only four may be employed by authors. The fifth style — Minimal — is a reserved style for use within Reference documentation:
- Note
- Tip
- Warning
- Important
- Minimal
Preview
Note
Oh me! Oh my! Oh me! Oh my! What a lot of funny
things go by.
Tip
I meant what I said, and I said what I meant. An elephant’s faithful, one hundred percent! And it should be, it should be, it SHOULD be like that! Because Horton was faithful! He sat and he sat!
“My goodness! My gracious!” they shouted. “MY WORD! It’s something brand new! IT’S AN ELEPHANT-BIRD!!”
Warning
So be sure when you step. Step with care and great tact, and remember that:
- Life’s a
- Great
- Balancing
- Act
Important
If we didn’t have birthdays, you wouldn’t be you. If you’d never been born, well then what would you do? If you’d never been born, well then what would you be? You might be a fish! Or a toad in a tree! You might be a doorknob! Or three baked potatoes! You might be a bag full of hard green tomatoes. Or worse than all that… why, you might be a WASN’T! A Wasn’t has no fun at all. No, he doesn’t. A Wasn’t just isn’t. He just isn’t present. But you… you ARE YOU! And, now isn’t that pleasant!
Assembly
mscorlib (in mscorlib.dll)
Code
Figures, Figure Captions, & Code Blocks
Figures are used as wrappers for code blocks, images, and videos. Apart from providing a semantic wrapper, they also allow the optional inclusion of captions via the <figcaption>
tag.
Preview
Following are examples of code blocks wrapped in figures. The first has a caption above it, and the second has the caption below it.
Code
Images & Videos
Images must be wrapped in <figure>
tags even if they don't require captions (for more details about adding captions to elements wrapped in figures, see Figures, Figure Captions, & Code). All common web image formats are supported: jpg, png, gif, svg (included animated).
Video is supported via the <video>
tag. UICF provides basic responsive block styling for video elements, however, videos will need to be integrated using an HTML5 video player component that is outside the scope of this framework.
Important
Images in UICF are furnished with basic responsive styling so they scale proportionally to fill no more than the width of their containers. However, this is the bare minimum. True responsive images take many more factors into account, and require the use of new standards like srcset
. They are out of scope for this first version of the UICF, but should be appropriately prioritized for future releases as they can dramatically improve the performance and user experience of web pages. More information about responsive images may be found here.
Preview
Code
Step-by-Step
This custom component may be used at the bottom of content that follows a step-by-step tutorial format. It contains two button components (i.e. all button features such as sizing and disabling are available) to navigate to the previous/next steps.
Preview
Code
Tables
Tables should be used to present content/data that is two-dimensional and tabular in nature. Tables should not be used to arbitrarily format information. For more information and examples around how to use tables, refer to Tables Guidance.
Preview
Style | Supported In Table? |
---|---|
Bold text | Yes |
Italicized text | Yes |
Yes | |
Inline code |
Yes |
Links | Yes |
Lists, Alerts, Code Blocks, Images, Videos, Buttons, Giraffes | No |
Code
Dropdowns
Dropdowns are toggleable menus that display a list of links. UICF provides a dropdown element that may be configured to span different sizes. The dropdown is used for various actions and functions in the frame of the reference and conceptual experiences (e.g. switching the language in for the reference experience for System.String
.
Preview
Dropdowns may provide a flat list of links:
Dropdowns may provide a grouped list of links:
Dropdowns come in three explicit sizes (apart from the default that sizes automatically): small, medium, & large, & full width:
Important
The dropdown UI element should not directly be made available for use in authoring documents. UICF provides a separate component — Doc-level Options — for allowing authors to embed UI with selectors and buttons within conceptual documents for scenarios like platform/language switching.
Code
Doc-level TOC
The Doc-level TOC component enables authors to list the major sections of their document at the top of the page and help users jump to the specific sections that they are interested in.
Preview
Code
Doc-level Options
The Doc-level Options component allows authors to embed other UI components (in this version: dropdowns & buttons) within conceptual documents to enable scenarios like language and platform switching. It is presented right below author metadata at the start of a conceptual document.
Preview
Code
Inheritance
The Inheritance component enables you to visually describe the inheritance hierarchy of an object. This component is a child of the alert component (minimalist style); it adds the ability to lay out an object hierarchy.
Preview
Inheritance Hierarchy
System.Object
System.String
Code
Member Details
The member details component is a very flexible and versatile component for the presentation of detailed technical lists including method parameters, return values, exceptions, REST resource properties, HTTP response codes, enumeration members, and more.
Structurally, each list item in the component consists of three parts:
- Meta: This provides two slots to encaspulate information like parameter name and type. Optionally, it can accept only one slot which is floated right. The type of information it accepts is configurable, but must always be wrapped in a
<code>
element. - Description: This part is used to present short-form information about the member, e.g. parameter description for a method. It is fairly flexible and should be able to accommodate a variety of inline styles. We recommend limiting the content within to paragraphs, links, and standard inline styles.
- Tags: This part is optional, but may be used for supplementary information. For instance, REST resoure properties, may indicate CRUD information, filterability, and so on.
Below you'll find various permutations of the same component to display all types of information.
Preview - REST Resource Properties
-
true
if the account is enabled; otherwise,false
. This property is required when a user is created. -
The licenses that are assigned to the user. Not nullable.
Code
Preview - REST API HTTP Response Codes
-
No Content. Indicates success. No response body is returned.
Code
Preview - Client SDK Method Parameters
-
A collection object that implements
IEnumerable<T>
and whose generic type argument isString
. -
A collection object that implements
IEnumerable<T>
and whose generic type argument isString
.
Code
Preview - Client SDK Method Returns
-
The concatenated strings in
values
.
Code
Preview - Client SDK Method Exceptions
-
values
is null. -
Out of memory.
Code
Preview - Client SDK Enumeration Members
-
No initialization action.
-
Register the COM callable wrapper for the current AppDomainManager with the unmanaged host.