wobsoriano / svelte-clerk

Community Clerk Svelte SDK.
Other
36 stars 4 forks source link

feat: Add support for custom menu items #61

Closed wobsoriano closed 1 month ago

wobsoriano commented 1 month ago

This PR adds support for custom menu items in <UserButton /> component!

<UserButton afterSignOutUrl="/">
    <UserButton.MenuItems>
        <!-- <UserButton.Action label="signOut" onclick={() => {}} /> -->
        <UserButton.Action label="Help" labelIcon={Icon} open="help" />
        <UserButton.Action
            label="Open chat"
            onclick={() => {
                console.log('init chat');
            }}
        >
           {#snippet labelIcon()}
                <Icon />
            {/snippet}
        </UserButton.Action>
        <UserButton.Link label="Profile" href="/profile" labelIcon={Icon} />
    </UserButton.MenuItems>
    <UserButton.UserProfilePage label="Help" url="help">
        {#snippet labelIcon()}
            <Icon />
        {/snippet}
        <div>
            <h1>Help Page</h1>
            <p>This is the custom help page</p>
        </div>
    </UserButton.UserProfilePage>
</UserButton>