forked from stack-auth/stack
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/s…
…dk/user-button.mdx
- Loading branch information
patched.codes[bot]
committed
Aug 20, 2024
1 parent
556609e
commit 25adbaa
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
title: UserButton | ||
--- | ||
|
||
# UserButton | ||
|
||
A React component that renders a user button with loading state handling. It uses React Suspense for loading fallback. | ||
|
||
## Parameters | ||
|
||
- `props`: `UserButtonProps` - The properties for the UserButton component. | ||
|
||
## Example | ||
|
||
```tsx | ||
import { UserButton } from '@stackframe/stack'; | ||
|
||
function MyComponent() { | ||
return ( | ||
<div> | ||
<h1>Welcome</h1> | ||
<UserButton | ||
// Add any necessary UserButtonProps here | ||
/> | ||
</div> | ||
); | ||
} | ||
``` | ||
|
||
## Notes | ||
|
||
- The component uses React Suspense for handling the loading state. | ||
- A Skeleton component is used as a fallback while the content is loading. | ||
- The actual button content is rendered by the `UserButtonInner` component once data is available. |