function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
si risi ri 

How to call Lightning component from visualforce component?

I would like to keep a link in the VF component and from that link I need to open Lightning component.
AnudeepAnudeep (Salesforce Developers) 
I know that we cannot use a visualforce component in lightning component. Unsure if we can use lightning components inside a VF component

Even if you have to do it, lightning out is the only way possible. 
<apex:component >
<apex:includeLightning />
        var myUserContext = "{!$User.UITheme}";
        $Lightning.use("c:sampleApp", function() {
            { UserContext: myUserContext },
            function(cmp) {
                console.log('component created');
    <apex:attribute name="myValue" description="This is the value for the component."
        type="String" required="true"/>

    <apex:attribute name="borderColor" description="This is color for the border."
        type="String" required="true"/>

    <h1 style="border:{!borderColor}">
        <apex:outputText value="{!myValue}"/>


You can give a try to see if it works

si risi ri
This one I already tried. Not working.