v2 Custom Field Render

How can I use/access styles from the Design System?

I want to apply a style from Design System on a button I created with Custom Field Renderer.



Code:

const FieldRenderer = skuid.component.FieldRenderer;

return new FieldRenderer({

    readModeStrategy: "virtual",

    read: function (fieldComponent) {

        let h = fieldComponent.h,

            context = fieldComponent.cpi.getContext();

            let { element, field, model, row, value } = context;

        

        let childNodes = [];

        childNodes.push(

            h("button", {

                onclick(event){

                    console.log('click1');

                }

            }, [

                `+`,

            ]));

        if(row.Added_By_User__c){

            childNodes.push(

            h("button", {

                onclick(event){

                    console.log('click2');

                }

            }, [

                `-`,

            ]));

        }

        return h('div', {}, childNodes);

    },

});

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!