A sign-in button for the common providers and your own. A neutral outline, a brand fill that keeps to Google, Apple and Microsoft's own styles, or just the icon.
Used for
- Sign-in and sign-up screens
- Linking an account in settings
- An SSO row with your own identity provider
- A compact icon row under an email form
Examples
Installation
npx knowns-ui@latest add social-buttonFor Claude Code, Cursor or Codex: installs it and wires the props to your own data.
Paste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install prompt
Install Social Button from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.
Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/social-button
1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).
2. Run:
```bash
npx knowns-ui@latest add social-button
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- components/ui/knowns/spinner.tsx
- components/ui/knowns/button.tsx
- lib/knowns/motion.tsx
- lib/knowns/motion-utils.ts
- components/ui/knowns/use-floating.ts
- components/ui/knowns/tooltip.tsx
- components/ui/knowns/tooltip-utils.ts
- components/ui/knowns/social-button/social-button.tsx
- lib/knowns/icons/social-icons.data.ts
- components/ui/knowns/social-button/social-utils.ts
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0, class-variance-authority@^0.7.1.
3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.
4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.
5. Use it: follow the examples and props on https://ui.knowns.dev/docs/social-button, and ask me if anything about my data is unclear.
If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "social-button" }) or search_docs for details.
Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.Props
- provider
SocialProvider|{ id, label, icon? }- One of the 24 built-in names, or your own.
- variant
outline|brand|icon- Default
outline - Neutral with a full-colour mark, the brand fill, or a square icon-only button.
- size
xs|sm|md|lg- Default
md - The Button sizes.
- verb
string- Default
Continue with - The aria-label is the verb plus the name, such as Sign in with Google.
- showVerb
boolean- Default
true for brand - Show the verb in the label, not only the name. The official styles ask for it.
- loading / disabled
boolean- Default
false - As the Button. A spinner replaces the mark; clicks are ignored while loading.
- Brand colours
-- Google: white or #131314 with a grey ring. Apple: black or white. Microsoft: white or #2F2F2F. The others use their own colour with black or white text.
- Logos
-- The marks are Simple Icons paths (CC0). Trademarks belong to their owners; use them under each provider's sign-in guidelines. See LICENSES.md.
| Prop | Type | Default | Description |
|---|---|---|---|
| provider | SocialProvider | { id, label, icon? } | - | One of the 24 built-in names, or your own. |
| variant | outline | brand | icon | outline | Neutral with a full-colour mark, the brand fill, or a square icon-only button. |
| size | xs | sm | md | lg | md | The Button sizes. |
| verb | string | Continue with | The aria-label is the verb plus the name, such as Sign in with Google. |
| showVerb | boolean | true for brand | Show the verb in the label, not only the name. The official styles ask for it. |
| loading / disabled | boolean | false | As the Button. A spinner replaces the mark; clicks are ignored while loading. |
| Brand colours | - | - | Google: white or #131314 with a grey ring. Apple: black or white. Microsoft: white or #2F2F2F. The others use their own colour with black or white text. |
| Logos | - | - | The marks are Simple Icons paths (CC0). Trademarks belong to their owners; use them under each provider's sign-in guidelines. See LICENSES.md. |
What it handles
- 01Ships marks for 24 providers and takes your own as { id, label, icon }.
- 02Three looks: a neutral outline with the full-colour mark, a brand fill, and a square icon-only button with a tooltip.
- 03Follows the official sign-in styles for Google, Apple and Microsoft in the brand look, light and dark, and never recolours their marks.
- 04Turns the near-black marks (Apple, GitHub, X, Notion, TikTok, Slack) white on a dark surface.
- 05Names each button for assistive tech as the verb plus the provider, such as Continue with GitHub, and hides the mark from it.
- 06Uses the Button sizes, loading state and disabled state as they are.
States
- Hover
- The surface shifts a little toward the text colour
- 120ms, ease-out
- Press
- The button scales to 0.97
- 120ms, ease-out
- Loading
- A spinner replaces the mark and the button ignores clicks
- none
- Focus
- A ring around the button
- colour only
- Reduced motion
- No press scale, no spinner sweep
- 0ms
| State | What moves | Timing |
|---|---|---|
| Hover | The surface shifts a little toward the text colour | 120ms, ease-out |
| Press | The button scales to 0.97 | 120ms, ease-out |
| Loading | A spinner replaces the mark and the button ignores clicks | none |
| Focus | A ring around the button | colour only |
| Reduced motion | No press scale, no spinner sweep | 0ms |
Works with
When to use
Using with AI
Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:
- Add the Knowns UI Social Button to my app and wire it to my own data.
- I need sign-in buttons for one-tap providers, in a row of full buttons or a row of icons. Set that up with the Knowns UI Social Button.
- Which Social Button props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "social-button" }) and search_docs({ query: "social button" }).