Skip to content

Components

ComponentSinceUpdatedStatusBlock
Accordion1.0.01.26.0Available
Action Item1.34.01.34.0Available
Avatar1.1.01.1.0Available
Badge1.13.01.13.0Available
Bio1.34.01.34.0Available
Breadcrumb1.0.01.0.0Available
Button1.0.01.15.0Available
Callout1.34.01.34.0Available
Card1.15.01.21.0Available
Chip1.18.01.26.0Available
Comparison Table1.0.01.0.0Available
Component Preview1.15.01.32.0Available
Course List1.1.01.14.0Available
Dialog1.0.01.18.0Available
Fact1.2.01.23.1Available
Featured List1.0.01.0.0Available
Feedback1.18.01.18.0Available
Filter List1.1.01.24.0Available
Filter1.1.01.24.0Available
Financial Calculator1.5.01.23.1Available
Floating Action Button1.34.01.34.0Available
Form1.8.01.8.0Available
Hero B1.11.01.21.0Available
Hero1.0.01.0.0Deprecated
Icon Button1.14.01.14.0Available
Icon Content1.18.01.18.0Available
Icon Heading1.0.01.0.0Deprecated
Icon1.0.01.0.0Available
Interior Menu1.0.01.0.0Planned
Menu1.1.01.18.0Available
One Column1.0.01.0.0Available
Page Header1.0.01.17.1Available
Pagination1.1.01.1.0Available
Popover1.5.01.5.0Available
Preview1.32.01.32.0Available
Program Compare Table1.1.01.27.0Complete
Programmatic Facts1.8.01.26.0Available
Quote1.0.01.22.0Available
Related Topic1.34.01.34.0Available
Section Header1.2.01.2.0Available
Site Footer Simple1.10.01.23.0Available
Site Footer1.0.02.3.0Available
Site Header Simple1.10.01.26.0Available
Slider1.0.01.23.1Available
Snipe1.14.01.14.0Available
Spotlight Cta1.34.01.34.0Available
Stats1.0.01.0.0Available
Sticky Cta1.0.01.0.0Available
Summary1.14.01.14.0Available
Table Of Contents1.34.01.34.0Available
Tabs1.1.01.23.1Available
Tile1.32.01.32.0Available
Two Columns1.0.01.0.0Available
Video1.1.01.1.0Available
Wide Image1.0.01.0.0Available

Structure

Markup for a component lives in /templates/components/.

Styling

Styling for a component is broken down into:

  1. /src/styles/core/components/{component}.scss
  2. /src/styles/theme-{theme}/components/{component}.scss

If any overrides are needed for styling in the Gutenberg editor, add them to the core or theme-specific editor stylesheets right after the component sass partial is included.

Adding a New Component

  1. Add /templates/components/{component}.twig and add HTML.
  2. Add /src/styles/core/components/{component}.scss for any styling needed.
  3. Create additional SCSS files for any modifications needed for themes like so: /src/styles/theme-{theme}/components/{component}.scss
  4. Make sure to import the new SCSS files to the main sheets as needed.
  5. Include the new component or set up a docs page to preview it.
  6. If any custom colors or other school-specific CSS need to be added, make sure to update any child themes.

Adding Component Docs

Add {component}.md and a matching {component}.json to /docs/components/. Optionally, {component}.js may be created if custom JS is needed for a component demo. The component JSON has the following parts:

KeyTypeRequiredDescription
releasestringYesInitial release version when the component was added
updatedstringYeslast release that changed this component
statusstringYesAvailable, Deprecated, In Progress
full_widthbooleanNoWhether this component is meant to be placed in a column container or not. An example of a full-width component is the two-columns. Defaults to false.
colorsbooleanNoIndicates whether the color picker should be available for all component previews. Can be overridden for each variation. Defaults to true.
gutenberg_blockinteger|arrayNoInteger or array of integers indicating whether a block exists for this component. 1 means a manual block exists, 2 means a block exists that uses this component and fills it with dynamic data and cannot be edited directly. Defaults to 0.
sample_dataarrayYesList of variations for previewing the component.

Sample Data

Each sample variation needs:

KeyTypeRequiredDescription
titlestringYesSimple text description that is slugified and used as an id for the section
dataobjectYesproperties of the component with sample data. If no data is provided, template must be used.
templatestringNofilename of a twig file to load.
colorsbooleanNoOptional boolean that overrides the value set for the whole component.
darkbooleanNoif the color picker is enabled, defaults it to a black background.
full_widthbooleanNoUsed to override value set for the whole component..

Data

Data can be used to map bits of information to the component's properties that get sent directly to the component. If a property's name is content (or includes "content") and it's an array of objects, the compiled preview will automatically include the specified inner components and render them. Each inner object should have name (component name string) and data (properties object). If an inner component's name is set to html, it will pass data as a string instead of trying to render a component.

Template

If a component does not have a .twig file associated with it, or you need to add additional items to properly showcase a component, replace data with template and specify a twig file created in the docs/components directory to be included instead.

Example

{
    "release": "1.0.0",
    "updated": "1.5.0",
    "full_width": false,
    "gutenberg_block": [1, 2],
    "sample_data": [
        {
            "title": "Default",
            "data": {
                "title": "C110 - Course Title",
                "label": "3 Credits",
                "content": [
                    {
                        "name": "html",
                        "data": "<p>Course Description.</p>"
                    },
                    {
                        "name": "button",
                        "data": {
                            "link": {
                                "url": "/url/to/course/",
                                "title": "View Full Course"
                            },
                            "style": "secondary"
                        }
                    }
                ]
            }
        },
        {
            "title": "Custom Template",
            "color_picker": false,
            "template": "accordion-custom.twig"
        }
    ]
}