Tree item<mds-tree-item>Generated from @maggioli-design-system/magma@2.3.0dist/documentation.json. Encapsulation: shadow.
Magma components are web components: custom elements you write like HTML tags, with any framework or without one. Props configure them, events tell you what happened, methods are functions you call on the element and slots take the content you put inside it.
Props
Set a prop as an HTML attribute in the markup, or as a property from JavaScript. The Attribute column gives the name of the attribute, a dash when it is the same as the property; props without one, such as arrays and functions, are set from JavaScript only. To turn a boolean attribute off, remove it: never write disabled="false".actions
-
auto | visible | undefinedShow actions on the tree item on hover or by default.
appearance
-
depth | none | undefinedReflects the parent tree appearance (set by mds-tree); drives the depth/none
layout without :host-context
async
-
boolean | undefinedSpecifies the tree should be opened asynchronously when after the click.
depth
-
number | undefinedSpecifies the tree branch depth. Internal: used by CSS to remove branch lines on first-level elements.
expanded
-
boolean | undefinedSpecifies if the tree is expanded.
icon
-
string | undefinedThe icon displayed in the button
label
-
stringSpecifies the label of the tree item
toggle
-
chevron | folder | undefinedSpecifies the icon of the element
togglePositiontoggle-positionleft | right | undefinedReflects the parent tree toggle icon position (set by mds-tree); drives the
toggle-icon layout without :host-context
truncate
-
all | none | word | undefinedwordTruncate the text of the element on one single line.
Events
mdsTreeItemCollapseMdsTreeItemEventDetailEmits when the component attribute selected is changed
mdsTreeItemExpandMdsTreeItemEventDetailEmits when the component expand it’s children container
Methods
expandexpand() => Promise<void>Expands the tree item, revealing its children.
refreshActionsrefreshActions() => Promise<void>internal Re-resolves the effective actions; called by mds-tree when its own
actions changes so items that inherit it stay in sync.
Slots
Slots take the content you write between the tags of the component. The default slot, the one without a name, accepts plain text, unless its description says otherwise. When the component has a label prop too, prefer the prop. Content for a named slot goes on a direct child with the name of the slot in its slot attribute, such as slot="action".(default)Add mds-tree-item element/s.
No slot name
actionAdd mds-button, mds-icon or other types component and HTML element/s.