Base

  • Colors
  • Icons
  • Logos
  • Spacing
  • Typography

Components

  • Accordion
  • Avatars
  • Badges
  • Buttons
  • Cards
  • Character Counter
  • Device Type Icons
  • Draggables
  • Dropdowns
  • Droppables
  • Filters
  • Gallery card
  • Indicators
  • Lists
  • Loading
  • Messages
  • Pictogram
  • Poster Play
  • Progress bar
  • QR Code
  • Rating stars
  • Row Selector
  • Sentiment
  • Split View
  • Tables
  • Tags
  • Tester vitals
  • Toast
  • Toggle button
  • Typeahead

Form

  • Checkbox
  • Combobox
  • Form Rule
  • Hint
  • Input
  • Input Title
  • Label
  • Multi-select List
  • Search
  • Select
  • Single-select List
  • Sliders
  • Switch
  • Tabs
  • Text Area

Layout

  • Containers
  • Layers
  • Layout
  • Split Layout
  • Wrappers

Navigation

  • Context Switcher
  • Nav bar
  • Navigation
  • Pagination
  • Sidebar Navigation
  • Step Navigation

Overlay

  • Banners
  • Bulk Selector
  • Modals
  • Popovers
  • Tooltips
  • User Notifications

Patterns

  • Full Page Message

Usertesting-next

  • Cards
  • Colors
  • Segmented Controls
  • Shadows and Elevations
  • Spacing
  • Typography

Visualizations

  • Data Colors

Dropdowns

Dropdowns are used to present individuals with a wide range of options and actions they can take.

Default

Expand Copy
<tk-dropdown trigger-text="School">
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Beauxbatons Academy
    </button>
  </tk-dropdown-item>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Durmstrang Institute
    </button>
  </tk-dropdown-item>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Hogwarts
    </button>
  </tk-dropdown-item>
</tk-dropdown>

Description

The dropdown text pattern is used when you need a dropdown action in a small space or near another body of text.

Pre-Trigger Text

Expand Copy
<tk-dropdown pre-trigger-text="Fantastic beast of choice" trigger-text="Nifflers">
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Bowtruckles
    </button>
  </tk-dropdown-item>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Nifflers
    </button>
  </tk-dropdown-item>
</tk-dropdown>

Description

This adds text before a dropdown trigger and bolds the call-to-action on the trigger. This is the only time we bold the dropdown trigger text.

Trigger with icon

Expand Copy
<tk-dropdown variant="primary" trigger-text="Wand Cores">
  <tk-icon class="mr-2x" name="folder" slot="trigger-icon" size="xs"></tk-icon>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Unicorn tail hair
    </button>
  </tk-dropdown-item>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Dragon heartstring
    </button>
  </tk-dropdown-item>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Phoenix feather
    </button>
  </tk-dropdown-item>
</tk-dropdown>

Description

The trigger-icon slot allows you to add an icon before a dropdown trigger. We discourage using an icon unless working with a high-level navigation element.

Flexible trigger content

Star
Expand Copy
<tk-dropdown>
  <div slot="trigger-content" class="l-flex l-v-center">
    <span>Star</span>
    <tk-icon class="ml-2x" name="star" variant="solid" size="xs"></tk-icon>
  </div>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Star Wars
    </button>
  </tk-dropdown-item>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Star Trek
    </button>
  </tk-dropdown-item>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Stardust
    </button>
  </tk-dropdown-item>
</tk-dropdown>

Description

The trigger-content slot allows you the flexibility to add any component or content for the trigger before the chevron icon.

Icon only trigger

Expand Copy
<tk-dropdown trigger-type="icon">
  <tk-sentiment-icon sentiment="positive" slot="trigger-icon"></tk-sentiment-icon>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Freshly mown grass
    </button>
  </tk-dropdown-item>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      New parchment
    </button>
  </tk-dropdown-item>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Spearmint toothpaste
    </button>
  </tk-dropdown-item>
</tk-dropdown>

Description

The trigger-icon slot allows you to define the dropdown trigger’s icon. We discourage using this icon only style unless working with a high-level navigation element.

Action

Expand Copy
<tk-dropdown trigger-type="action" button-label="See Howler options">
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Send a Howler
    </button>
  </tk-dropdown-item>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Recieve a Howler
    </button>
  </tk-dropdown-item>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Delete a Howler
    </button>
  </tk-dropdown-item>
</tk-dropdown>

Description

The three dots icon is used to infer that more actions can be found in this dropdown. When using the Action component ensure there are at least two or more items in the dropdown. If there are multiple versions of this dropdown (e.g., you’re using it within a tk-list-row ), then you’ll need to set a unique aria-label for each one via the label property. This will make the actions distinguishable for a screen reader. When the label property is unset, the aria-label defaults to More options.

Insight

Users quickly and easily understood what the “…” icon meant

Variant: Light

Expand Copy
<tk-dropdown trigger-type="action" light="true">
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Purchase a broom
    </button>
  </tk-dropdown-item>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Sell a broom
    </button>
  </tk-dropdown-item>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Report damaged broom
    </button>
  </tk-dropdown-item>
</tk-dropdown>

Description

Should only be used on dark backgrounds that maintain a minimum color contrast ratio of 4.5. Can be used on the default dropdown as well. When using the Action component ensure there are at least two or more items in the dropdown.

Variant: Primary

Expand Copy
<tk-dropdown variant="primary" trigger-text="New">
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Spell
    </button>
  </tk-dropdown-item>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Charm
    </button>
  </tk-dropdown-item>
</tk-dropdown>

Description

This style uses our primary brand color to draw attention. It should only be used to convey primary actions.

Variant: Secondary

Expand Copy
<tk-dropdown variant="secondary" trigger-text="New">
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Spell
    </button>
  </tk-dropdown-item>
  <tk-dropdown-item active>
    <button class="dropdown__link" type="button">
      Charm
    </button>
  </tk-dropdown-item>
</tk-dropdown>

Description

This style uses our button pattern and usually appears next to other buttons. The dropdown button uses the secondary action pattern.

Variant: Outline

Expand Copy
<tk-dropdown variant="outline" trigger-text="New">
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Spell
    </button>
  </tk-dropdown-item>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Charm
    </button>
  </tk-dropdown-item>
</tk-dropdown>

Description

Outline dropdowns visually work best sitting next to form fields. This option is a more subtle version of the Primary and Secondary variant dropdowns.

Disabled

Copy
<tk-dropdown trigger-text="Contact" is-disabled>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Newt Scamander
    </button>
  </tk-dropdown-item>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Tina Goldstein
    </button>
  </tk-dropdown-item>
</tk-dropdown>

Description

Our default disabled style for dropdown buttons.

Active

Expand Copy
<tk-dropdown trigger-text="George Weasley">
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Fred Weasley
    </button>
  </tk-dropdown-item>
  <tk-dropdown-item active>
    <button class="dropdown__link" type="button">
      George Weasley
    </button>
  </tk-dropdown-item>
</tk-dropdown>

Description

The active state should only be used when the selected option is reflected in the dropdown trigger. It displays a checkmark so that the list is easier to visually scan.

Subheader and Subtext

Expand Copy
<tk-dropdown trigger-text="My Account">
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Hogsmeade Status
      <span class="dropdown__subtext">Permission slips and waivers</span>
    </button>
  </tk-dropdown-item>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Triwizard Tournament
      <span class="dropdown__subtext">Match information and standings</span>
    </button>
  </tk-dropdown-item>
  <hr class="dropdown__rule">
  <p class="dropdown__subheader">
    My organizations
  </p>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Quidditch Team
    </button>
  </tk-dropdown-item>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      S.P.E.W.
    </button>
  </tk-dropdown-item>
</tk-dropdown>

Description

When a dropdown item requires more information you can use the subheader and subtext pattern to add context to the items in the dropdown.

Account Menu

Sirius Black

padfoot@hogwarts.edu

O.W.L.s
Expand Copy
<tk-dropdown avatar-type="light" trigger-type="avatar" full-height="true" trigger-text="SB">
  <tk-dropdown-header>
    <h3 class="t-base t-heavy mb-0x" slot="header-title">Sirius Black</h3>
    <h4 slot="header-subtitle">padfoot@hogwarts.edu</h4>
  </tk-dropdown-header>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Course schedule
    </button>
  </tk-dropdown-item>
  <tk-dropdown-item>
    <a class="dropdown__link" href="#">
      O.W.L.s
    </a>
  </tk-dropdown-item>
  <tk-dropdown-footer>
    <tk-dropdown-item>
      <button class="dropdown__link" type="button">
        Sign Out
      </button>
    </tk-dropdown-item>
  </tk-dropdown-footer>
</tk-dropdown>

Description

The account menu is used in the main app header for both customers and testers. Usually contains navigational items that link to top-level pages across the app.

Menu Position






Expand Copy
<tk-dropdown trigger-text="Default">
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      The default is to display the menu to the bottom right.
    </button>
  </tk-dropdown-item>
</tk-dropdown>

<hr>

<tk-dropdown position="bottom-left" trigger-text="Bottom Left Dropdown">
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      For the rare cases you need it, this positions the menu to the bottom left.
    </button>
  </tk-dropdown-item>
</tk-dropdown>

<hr>

<tk-dropdown position="left" trigger-text="Left Dropdown">
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      This will be to the left of the trigger.
    </button>
  </tk-dropdown-item>
</tk-dropdown>

<hr>

<tk-dropdown position="right" trigger-text="Right Dropdown">
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      This will be to the right of the trigger.
    </button>
  </tk-dropdown-item>
</tk-dropdown>

<hr>

<tk-dropdown position="top-left" trigger-text="Top Left Dropdown">
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      This will be above and to the left of the trigger.
    </button>
  </tk-dropdown-item>
</tk-dropdown>

<hr>

<tk-dropdown position="top-right" trigger-text="Top Right Dropdown">
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      This will be above and to the right of the trigger.
    </button>
  </tk-dropdown-item>
</tk-dropdown>

Description

Generally we want to use the default positioning, so that the menu is anchored to the trigger icon. However, in certain instances, you may need to position the menu, such as the in the bulk selector pattern.

Click Options



Expand Copy
<tk-dropdown position="top-right" close-trigger="outsideClick" trigger-text="Outside Click (default)">
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      This will close with a click outside the menu.
    </button>
  </tk-dropdown-item>
</tk-dropdown>

<hr>

<tk-dropdown position="top-right" close-trigger="insideClick" trigger-text="Inside Click">
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      This will close with a click inside the menu.
    </button>
  </tk-dropdown-item>
</tk-dropdown>

<hr>

<tk-dropdown position="top-right" close-trigger="anyClick" trigger-text="Any Click">
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      This will close with any click.
    </button>
  </tk-dropdown-item>
</tk-dropdown>

Description

The account menu is used in the main app header for both customers and testers. Usually contains navigational items that link to top-level pages across the app.

Stacking utils

Expand Copy
<tk-dropdown class="l-sm-block" variant="primary" trigger-text="Wand Cores">
  <tk-icon class="mr-2x" name="folder" slot="trigger-icon" size="xs"></tk-icon>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Unicorn tail hair
    </button>
  </tk-dropdown-item>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Dragon heartstring
    </button>
  </tk-dropdown-item>
  <tk-dropdown-item>
    <button class="dropdown__link" type="button">
      Phoenix feather
    </button>
  </tk-dropdown-item>
</tk-dropdown>

Description

For times when dropdowns need to stack and/or display full-width on smaller screens, we have classes that provide that functionality. Use l-md-block for screens stacking at medium screensizes and use l-sm-block for stacking at small screensizes.

Plain HTML - Disabled

Expand Copy
<div class="drop-menu">
  <div class="dropdown">
    <select class="dropdown__trigger" disabled>
        <option value="Value1">Dropdown Option</option>
        <option value="Value2">Dropdown Option</option>
        <option value="Value3">Dropdown Option</option>
    </select>
  </div>
</div>

Description

Use the disabled pattern to block usage of a dropdown text element.

Full Width

Expand Copy
<div style="width: 300px;">
  <tk-dropdown full-width variant="primary" trigger-text="Ghouls and Goblins">
    <tk-dropdown-item>
      <button class="dropdown__link" type="button">
        Ghouls
      </button>
      <button class="dropdown__link" type="button">
        Goblins
      </button>
    </tk-dropdown-item>
  </tk-dropdown>
</div>

Description

Used to match the width of items in the dropdown menu and trigger to their parent container.

Usage

Do

  • Include clear and concise actions to take or pages to navigate to
  • Use expanded dropdowns to provide additional information

Don't

  • Hide primary actions within dropdowns
  • Add a lot of items to a dropdown list

Events

Name Description
close Emitted whenever the dropdown menu is closed.
open Emitted whenever the dropdown menu is opened.

Accessibility

  • Receives :focus

  • <a> is used when there is a need to navigate to another page or view. If you use <a> please add tabindex="0".

  • <button> is used when there is a need for the user to take an action that requires a submit.

  • <select> is used when users must make a choice within a form.

  • <tk-dropdown> takes a role-type prop with a default value of list which is passed down to <tk-dropdown-menu> and can be overridden to best fit your particular use case.

  • <tk-dropdown-item> takes a role prop with a default value of listitem which can be overridden to best fit your particular use case.