Skip to content

ARyaskov/vk-signin-widget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VK Signin Widget for React

NPM Version NPM Downloads NPM Unpacked Size

Unofficial VK signin button component for React 18

Usage

import { VkSignInButton } from "@riaskov/vk-signin-widget"

<VkSignInButton
    appId={12345678}
    redirectURL={"https://example.com"}>
</VkSignInButton>

Docs

Params

Param Type Description
appId (required) number App ID from VK ID Management Console
redirectURL (required) string One of Trusted redirect URLs from VK ID Management Console
className string One or more space-separated classes (see available further in docs), just names, no dots before classes!
onClickBeforeLogin(e) Function Callback to execute before redirecting to id.vk.com
state string Random data for passing to redirectURL

"className" param and UI

className UI
without any className provided image
btn-secondary image
rounded-1 image
rounded-2 image
rounded-3 image
no-text image
btn-sm image
btn-lg image
btn-secondary no-text image
no-text rounded-3 image

You can combine classes to get the desired UI, e.g. className="btn-secondary rounded-1 no-text"

Acknowledgements

VK logo images received from public VK ID Docs; all rights on VK assets and trademark belong to VK