Skip to content

Commit c56a8dd

Browse files
author
patched.codes[bot]
committed
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/sdk/oauth-button.mdx
1 parent d9bd5d2 commit c56a8dd

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: OAuthButton
3+
---
4+
5+
# OAuthButton
6+
7+
A customizable OAuth button component for sign-in or sign-up functionality with various providers.
8+
9+
## Parameters
10+
11+
- `provider`: `string` - The OAuth provider (e.g., 'google', 'github', 'facebook', 'microsoft', 'spotify').
12+
- `type`: `'sign-in' | 'sign-up'` - The type of action, either 'sign-in' or 'sign-up'.
13+
14+
## Example
15+
16+
```tsx
17+
import { OAuthButton } from '@stackframe/stack';
18+
19+
// Sign-in button for Google
20+
const GoogleSignInButton = () => (
21+
<OAuthButton provider='google' type='sign-in' />
22+
);
23+
24+
// Sign-up button for GitHub
25+
const GitHubSignUpButton = () => (
26+
<OAuthButton provider='github' type='sign-up' />
27+
);
28+
29+
// Usage in a component
30+
const AuthButtons = () => (
31+
<div>
32+
<GoogleSignInButton />
33+
<GitHubSignUpButton />
34+
</div>
35+
);
36+
```
37+
38+
The `OAuthButton` component automatically styles the button based on the provided OAuth provider and handles the sign-in or sign-up process when clicked.

0 commit comments

Comments
 (0)