github carbon-design-system/carbon-components-svelte v0.82.0

latest releases: v0.89.7, v0.89.6, v0.89.5...
22 months ago

What's Changed

Full Changelog: v0.81.3...v0.82.0


This release focuses on TreeView improvements.

TreeView node is slottable

Previously, the TreeView used the node.text value. Now, you can destructure let:node and override the default slot to customize the rendered content and styles on a per-node basis.

See an example.

<TreeView children="{children}" let:node>
  {node.id}
  {node.text}
  {node.expanded}
  {node.selected}
  {node.disabled}
  {node.leaf} <!-- True if the node is a leaf (node does not have children) -->
</TreeView>

Programmatically "show" a TreeView node

The TreeView component now supports a showNode accessor to show a specific node.

Given the node.id, the matching node will be expanded, selected, and focused.

See an example.

treeview?.showNode(node.id);

Don't miss a new carbon-components-svelte release

NewReleases is sending notifications on new releases.