Accessibility Compliance
SurveyJS libraries meet a variety of WCAG and Section 508 standards. Run AXE® Validation to assess this demo’s accessibility level.

Manage Toolbox Subitems

Edit in →

Toolbox subitems are preconfigured templates grouped under a parent toolbox item. They appear when users hover over that item. Selecting a subitem adds a survey element with preset properties. This demo shows how to add custom subitems and manage built-in subitems. Hover over a toolbox item to view its subitems. For demonstration purposes, available toolbox items are limited to those that have subitems.

Subitems are unavailable in a compact toolbox. This demo sets forceCompact to false to keep the full toolbox visible.

To create a custom subitem, pass its configuration object to the addSubitem(subitem, index) method. Call this method on the parent toolbox item instance. The name property identifies the subitem, title supplies its label, and json defines the survey element to create. For instance, the following code adds a "Limited to 280 characters" subitem to the Long Text toolbox item:

const longTextItem = creator.toolbox.getItemByName("comment");
longTextItem.addSubitem({
    name: "limitedLongText",
    title: "Limited to 280 characters",
    json: {
        type: "comment",
        maxLength: 280
    }
});

In addition, this demo includes the following custom subitems:

  • Dynamic Panel – Tabbed UI and Carousel UI.
  • Rating Scale – Customer Satisfaction Score and Net Promoter Score.
  • Radio Button Group, Dropdown, and Single-Select Matrix – Agree – Disagree, Frequency, Understanding, Likely – Unlikely, and Yes / No.

If you want to remove a specific subitem, call the removeSubitem(subitem) method on a toolbox item instance. The following list contains the predefined subitems available by default:

  • Rating Scale – "labels", "stars", "smileys"
  • Single-Line Input – "color", "date", "datetime-local", "email", "month", "number", "password", "range", "tel", "text-default", "time", "url", "week"
// Remove the Labels subitem from the Rating Scale toolbox item
const ratingScaleItem = creator.toolbox.getItemByName("rating");
ratingScaleItem.removeSubitem("labels");

You can also remove all subitems from a toolbox item by calling the clearSubitems() method:

// Remove all subitems from the Single-Line Input toolbox item
const singleLineInputItem = creator.toolbox.getItemByName("text");
singleLineInputItem.clearSubitems();

Toolbox subitems act like shortcuts for creating certain question configurations. Removing a subitem doesn't remove the associated properties from the Property Grid. If you need to prevent users from editing them, hide those properties explicitly.

You can completely deactivate the subitems feature by disabling the Toolbox's showSubitems property:

creator.toolbox.showSubitems = false;

Your cookie settings

We use cookies to make your browsing experience more convenient and personal. Some cookies are essential, while others help us analyse traffic. Your personal data and cookies may be used for ad personalization. By clicking “Accept All”, you consent to the use of all cookies as described in our Terms of Use and Privacy Statement. You can manage your preferences in “Cookie settings.”

Your renewal subscription expires soon.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.

Your renewal subscription has expired.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.