Button
A versatile button component with multiple variants and sizes.
import { Button } from "@/components/ui/button/button";
export default function ButtonDemo() {
return <Button>Button</Button>;
}
npx shadcn@latest add @roiui/buttonnpx shadcn@latest add @roiui/button-tailwindanatomy
<Button></Button>import { Button } from "@/components/ui/button/button";
export default function ButtonSecondary() {
return <Button variant="secondary">Secondary</Button>;
}
import { Button } from "@/components/ui/button/button";
export default function ButtonDestructive() {
return <Button variant="destructive">Destructive</Button>;
}
import { Button } from "@/components/ui/button/button";
export default function ButtonOutline() {
return <Button variant="outline">Outline</Button>;
}
import { Button } from "@/components/ui/button/button";
export default function ButtonGhost() {
return <Button variant="ghost">Ghost</Button>;
}
import { Button } from "@/components/ui/button/button";
export default function ButtonDisabled() {
return <Button disabled>Disabled</Button>;
}
"use client";
import { Button } from "@/components/ui/button/button";
import styles from "./button-loading.module.css";
export default function ButtonLoading() {
return (
<div className={styles.container}>
<Button loading={true}>Always Loading</Button>
</div>
);
}
import { Button } from "@/components/ui/button/button";
export default function ButtonExternalLink() {
return (
<Button pointExternal render={<a href="#" />} showArrow style={{ borderRadius: "30px" }} variant="outline">
View External
</Button>
);
}
import { Button } from "@/components/ui/button/button";
export default function ButtonWithArrow() {
return <Button showArrow>With Arrow</Button>;
}
Component props
Prop
Type
Default
Name
variantDescription
The visual style variant of the button
Type
"primary" | "secondary" | "destructive" | "ghost" | "icon" | "outline" | "link"Default
"primary"Name
sizeDescription
The size of the button
Type
"sm" | "md" | "lg"Default
"md"Name
renderDescription
Custom element to render the button as (e.g., Link, anchor tag). Enables polymorphic behavior.
Type
ReactElementDefault
-
Name
showArrowDescription
Whether to show an arrow indicator next to the button content
Type
booleanDefault
falseName
pointLeftDescription
When showArrow is true, controls if the arrow points left instead of right
Type
booleanDefault
falseName
pointExternalDescription
When showArrow is true, applies external link arrow styling (diagonal orientation)
Type
booleanDefault
falseName
loadingDescription
Shows a spinner on the left side and disables the button when true
Type
booleanDefault
falseName
classNameDescription
Additional CSS classes to apply to the button
Type
stringDefault
-
Name
childrenDescription
The content to display inside the button
Type
ReactNodeDefault
-
Name
disabledDescription
Whether the button is disabled and non-interactive
Type
booleanDefault
falseName
onClickDescription
Function to call when the button is clicked
Type
functionDefault
-
Name
typeDescription
The type attribute of the button element
Type
"button" | "submit" | "reset"Default
"button"