Skip to Content
Nextra 4.0 is released 🎉

Button

The Button component is a core PixelartUI UI element that provides a pixel-art styled interactive control.
It supports multiple style, sizes, and types to fit different use cases while preserving the retro aesthetic.


🚀 Usage

Basic Example


import { Button } from "pixelartui-react"; <Button buttonSize="medium" buttonType="main" text="Main" onClick={mockFunction} />;

Button Types


<Button buttonSize="medium" buttonType="main" text="Main" onClick={mockFunction} /> <Button buttonSize="medium" buttonType="outline" text="Outline" onClick={mockFunction} />

Button Sizes


<Button buttonSize="small" buttonType="main" text="Small" onClick={mockFunction} /> <Button buttonSize="medium" buttonType="main" text="Medium" onClick={mockFunction} /> <Button buttonSize="large" buttonType="main" text="Large" onClick={mockFunction} />

Button Styles


<Button buttonSize="medium" buttonType="main" buttonStyle="dark" text="Dark" onClick={mockFunction} /> <Button buttonSize="medium" buttonType="outline" buttonStyle="light" text="Light" onClick={mockFunction} />

Button Fullwidth


<Button buttonSize="medium" buttonType="main" text="Fullwidth" onClick={mockFunction} fullwidth />

Button Round


<Button buttonSize="medium" buttonType="main" text="Round" onClick={mockFunction} round />

Button Disabled


<Button buttonSize="medium" buttonType="main" text="Round" onClick={mockFunction} disabled />

Button Custom Color


<Button buttonSize="medium" buttonType="main" text="New Color" onClick={mockFunction} backgroundColor="#05EB57" />

Button Custom Size


<Button buttonSize="medium" buttonType="main" text="Custom Size" width="300px" height="200px" onClick={mockFunction} />

🔧 Props

PropTypeDefaultDescription
type"main" | "outline""main"Determines the button’s visual style, switching between a solid primary appearance or an outlined variant.
size"small" | "medium" | "large""medium"Controls the button’s overall scale, adjusting padding and font size.
style"dark" | "light""dark"Applies a light or dark theme to the button’s visual design.
fullwidthbooleanfalseMakes the button expand to fill the width of its container.
roundbooleanfalseRenders the button with fully rounded (pill-shaped) corners.
backgroundColorstringundefinedOverrides the default background color with a custom value.
disabledbooleanfalseDisables interaction and visually indicates that the button is inactive.
widthstringundefinedSets a custom width for the button (e.g., "200px" or "50%").
heightstringundefinedSets a custom height for the button.
classNamestringundefinedAdds additional CSS classes for custom styling.
onClick() => voidFunction executed when the button is clicked.
Last updated on