Source code
Revision control
Copy as Markdown
Other Tools
import figma, { html } from "@figma/code-connect/html";
// Desktop Components v3 (newest)
figma.connect(
{
props: {
items: figma.children("*"),
},
example: props =>
html` <panel-list open id="panel-list"> ${props.items} </panel-list>`,
}
);
figma.connect(
{
props: {
label: figma.string("Label"),
iconSrc: figma.boolean("Show icon", {
}),
disabled: figma.enum("State", { Disabled: true }),
badged: figma.boolean("Show badge"),
submenu: figma.boolean("Show submenu"),
rule: figma.boolean("Show separator", {
true: "<hr />",
}),
},
example: props =>
html` <panel-item
icon=${props.iconSrc}
disabled=${props.disabled}
badged=${props.badged}
submenu=${props.submenu}
>
${props.label}
</panel-item>
${props.rule}`,
}
);