components/BrowserSignIn
import { … } from 'zidane-ui'ui/src/components/BrowserSignIn.tsx
Components#
BrowserSignInComponent#
Renders a browser sign-in's current state, with Cancel while it runs and Retry once it failed.
function BrowserSignIn(props: BrowserSignInProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | BrowserSignInProps | Component props. |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the panel. |
| onCancel? | () => void | Stops the sign-in. Absent: no Cancel button. |
| onRetry? | () => void | Starts it again after a failure. Absent: no Retry button. |
| onSubmit? | (text: string) => void | Called with what the user typed: the answer to a |
| service | string | What is being signed in to, such as "Anthropic". |
| state | BrowserSignInState | Where the sign-in is. |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |
Interfaces#
BrowserSignInPropsInterface#
Props for BrowserSignIn.
interface BrowserSignInPropsProperties
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the panel. |
| onCancel? | () => void | Stops the sign-in. Absent: no Cancel button. |
| onRetry? | () => void | Starts it again after a failure. Absent: no Retry button. |
| onSubmit? | (text: string) => void | Called with what the user typed: the answer to a |
| service | string | What is being signed in to, such as "Anthropic". |
| state | BrowserSignInState | Where the sign-in is. |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |
Types#
BrowserSignInStateType#
Where a browser sign-in is.
starting: the flow is starting.url: the sign-in page is open in the browser.instructionsis the provider's own line, when it has one.device: a device flow:userCodegoes on the page aturl.prompt: the provider asks a question, such as a code to paste, or picks amongoptions.progress: a status line while it finishes.done: signed in, asaccountwhen the provider names it.error: it failed.
type BrowserSignInState =
| { kind: 'starting' }
| { instructions?: string; kind: 'url'; url: string }
| { expiresInSeconds?: number; kind: 'device'; url: string; userCode: string }
| { kind: 'prompt'; message: string; options?: readonly string[]; placeholder?: string }
| { kind: 'progress'; message: string }
| { account?: string; kind: 'done' }
| { kind: 'error'; message: string }