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

Toast

Toast gives customers helpful information about the success or failure of their action

Success! Your test has been submitted for review
Show Toast
Copy
<tk-toast show-toast="false" show-undo="false" onUndo="doUndo()">
  <div class="mr-2x">Success! Your test has been submitted for review</div>
</tk-toast>
<tk-button
  aria-haspopup="true"
  onClick="showToast()"
>Show Toast</tk-button>
<script>
  const toastComponent = document.getElementsByTagName('tk-toast')[0];
  toastComponent.showToast = false;
  toastComponent.showUndo = true;
  toastComponent.addEventListener('undo', () => alert('Undo Clicked'));
  const showToast = () => {
    toastComponent.showToast = true;
  }
</script>

Description

The toast component displays a notification when show-toast is set to true.

Using within a framework:

Requires show-toast Prop to be bound, so that it’s set as an object instead of a string. In Angular, this is: [showToast]='[{ your object }]'.

Using without a framework:

This requires JS to set the show-toast Prop, otherwise it’ll treat the value as a string. Read More →

tk-toast

Properties

Property Attribute Description Type Default
showToast show-toast Sets the visibility of the toast component. boolean false
showUndo show-undo Sets the visibility of the undo button. boolean false

Events

Event Description Type
undo Emits an event when the undo button is clicked. CustomEvent<any>

Usage

Do

  • Use the component for short messages that don’t require additional user action
  • Use the component for invisible state changes that may affect the user experience in unexpected ways

Don't

  • Block other overlay messages, such as modals
  • Use the component for long, complex messages

Theming

This component will receive a different set of styles based on the active --tk-theme CSS property. To receive theme styling: set :root { --tk-theme: userTestingTheme } in your main CSS file.