For single- and multi-select list arguments, you can now categorize values.
Here's an example:
window.CommandBar.addContext("students",
[
{ name: "Anna", id: 1, category: "3rd Grade" },
{ name: "Billy", id: 2, category: "3rd Grade" },
{ name: "Charles", id: 3, category: "3rd Grade" },
{ name: "Devika", id: 4, category: "2nd Grade" },
{ name: "Earl", id: 5, category: "2nd Grade" },
{ name: "Fiona", id: 6, category: "2nd Grade" },
]);
Let's say we have a command called Grade student
with one argument, a single-select list defined by a record called students
. By specifying the category key above, here's how the command would look after the user selects it:
How can I turn this on? ðŸ›
If you pass in the category
key for records, they will just work! No setting toggle required.