Skip to Content
Hotdog-ui beta is released 🎉
GeneralButton

Button

To trigger an operation.

When To Use

A button means an operation (or a series of operations). Clicking a button will trigger its corresponding business logic.

In Hotdog-Ui we provide 6 types of button.

  • 🔵 Default button: used for the main action, there can be at most one default button in a section.
  • ⚪️ Ghost button: used for a series of actions without priority.
  • 🔳 Outline button: used for actions with a clear boundary.
  • 😶 Dashed button: commonly used for adding more actions.
  • 🔤 Text button: used for the most secondary action.
  • 🔗 Link button: used for external links.

And we provide 2 animations for buttons.

  • 🏃‍♂️ Ripple: creates a wave effect on click.
  • 🏃‍♀️ Pulse: makes the button grow and shrink continuously.

Colors are also customizable, you can choose from:

Primary
Secondary
Warning
Success
Info
Sharp
Muted
Accent

Installation

npx shadcn@latest add https://hotdogui.com/registry/button.json

Examples

Button Variants

Button variants allow you to customize the appearance and behavior of buttons to fit different use cases.

Button Colors

Button colors allow you to customize the appearance of buttons to fit different themes and branding requirements.

Color And Variant Combinations

Animations

Animation effects can enhance the user experience by providing visual feedback when interacting with buttons.

Animation And Variant Combinations

Sizes

Button sizes allow you to adjust the dimensions of buttons to fit different layouts and design requirements.

Shapes

Loading and Disabled States

Button Group

Api

PropertyDescriptionTypeDefault
variantThe variant of the button

defaultghostoutlinedashedtextlink

default
animationSet the animation of button

noneripplepulsebuttonshine

ripple
blockOption to fit button width to its parent width

boolean

false
classNamesSemantic DOM class

Record<SemanticDOM, string>

-
colorSet button color

primarysecondarydangerwarningsuccesssharpinfomutedaccent

primary
disabledDisabled state of button

boolean

false
typeSet the original html type of button

submitresetbutton

button
loadingSet the loading status of button

boolean

false
shapeCan be used to set button shape

roundedsquarecircle

rounded
sizeSet the size of button

defaultlargesmallicon

default
stylesSemantic DOM style

Record<SemanticDOM, CSSProperties>

-
onClickSet the handler to handle click event

(event: React.MouseEvent<HTMLElement, MouseEvent>) => void

-
asChildIf true, the button will not render a button element, but instead render its children as the root element

boolean

false
Last updated on