Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

In carbon-components-svelte TreeView: how to change cursor to pointer on hover of a children?

The examples from https://carbon-components-svelte.onrender.com/components/TreeView can’t do that, but the left tree in the document itself can.

Wondering how is that achieved?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The "tree" on the left is the SideNav which is part of the UI shell. It just has that cursor change as part of its default styling.

If you want to override the style of the tree view, you just have to add some additional CSS.

/* Within a component :global(...) needs to be used */
.bx--tree-node  {
    cursor: pointer;
}

REPL example

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading