Buttons
Button component with colors, rounded corners, a loading state, an icon button for any icon you choose and social sign in buttons for Facebook, X, Github, Google and Apple.
How to use it
Run npx @blossomui/react add button, or copy src/components/UI/Buttons/Button.tsx into your React project and import it.
import { Button, IconButton, SocialButton } from './components/ui/Button'
Props
ButtonProps
| Prop | Type | Description |
|---|
| color | ButtonColor | (string & {}) | Visual style of the button: a preset, `accent` for the brand color (`--blossom-accent`) or any CSS color such as `#7c3aed`. |
| rounded | boolean | Use fully rounded (pill) corners. |
| loading | boolean | Shows a spinner and disables the button. |
| size | 'sm' | 'md' | 'lg' | |
| icon | ReactNode | Optional icon placed before the label. |
IconButtonProps
| Prop | Type | Description |
|---|
| icon (required) | ReactNode | Any element: an icon from the library you prefer or your own SVG. |
| label (required) | string | What the button does. It is the accessible name, because the button has no text. |
| color | ButtonColor | (string & {}) | A preset or any CSS color. |
| size | IconButtonSize | |
| rounded | boolean | Use a circle instead of rounded corners. |
| loading | boolean | Shows a spinner and disables the button. |
SocialButtonProps
| Prop | Type | Description |
|---|
| provider (required) | SocialProvider | |
| label | string | Text of the button, for example to translate it. Without it the text is "Sign in with" and the name of the provider. |
| iconOnly | boolean | Render only the icon. |
| rounded | boolean | |