Back to Shark UI

Button

docs/components/button

latest7.0 KB
Original Source

Sections

Components

Utilities

Forms

Hooks

Button

Copy Markdown

A button or an element styled as a button.

PreviewCode

Button

Installation#

CLIManual

pnpmbunnpmyarn

pnpm dlx shadcn@latest add @shark/button

Usage#

import { Button } from "@/components/ui/button";
<Button>Button</Button>

The asChild prop renders another element with button styling.

PreviewCode

Login

States#

Disabled#

PreviewCode

Send

Loading#

PreviewCode

LoadingLoading

Variants#

Default#

PreviewCode

Default

Outline#

PreviewCode

Outline

Secondary#

PreviewCode

Secondary

Ghost#

PreviewCode

Ghost

PreviewCode

Link

Destructive#

PreviewCode

Destructive

Sizes#

Extra Small#

PreviewCode

Button

Small#

PreviewCode

Button

Large#

PreviewCode

Button

Extra Large#

PreviewCode

Button

Pill#

PreviewCode

Add

Disabling click effect#

PreviewCode

Button

Examples#

Icon only#

Add aria-label prop to the button so screen readers can identify the button.

PreviewCode

With icon#

PreviewCode

AddSettingsFavoriteDownloadVisit website

Touch hitbox#

For increasing the tap target area, use Hitbox.

PreviewCode

Show hitbox

hitbox-6

Custom color#

PreviewCode

IndigoPinkSkyPurple

API Reference#

PropTypeDefault
variant`"default""outline"
size`"xs""sm"
clickEffectbooleantrue
isLoadingbooleanfalse
classNamestring-
asChildbooleanfalse

[

Previous page

Button Group ](/docs/components/button-group)[

Next page

Calendar ](/docs/components/calendar)

On This Page

InstallationUsageLinkStatesDisabledLoadingVariantsDefaultOutlineSecondaryGhostLinkDestructiveSizesExtra SmallSmallLargeExtra LargePillDisabling click effectExamplesIcon onlyWith iconTouch hitboxCustom colorAPI Reference