Park UI Logo
GitHub
Components
Button

Button

An interactive element used to trigger actions.

import { ArrowRightIcon } from 'lucide-react'
import { Button, type ButtonProps } from '~/components/ui/button'

export const Demo = (props: ButtonProps) => {
  return (
    <Button {...props}>
      Button
      <ArrowRightIcon />
    </Button>
  )
}

Usage

import { Button } from '~/components/ui/button'

Examples

With a different color

Use the colorPalette prop to change the color of the button.

<HStack>
  <Button colorPalette="red" variant="solid">
    Button
  </Button>
  <Button colorPalette="red" variant="subtle">
    Button
  </Button>
  <Button colorPalette="red" variant="outline">
    Button
  </Button>
  <Button colorPalette="red" variant="ghost">
    Button
  </Button>
</HStack>

With loading indicator

Use the loading prop to show a loading spinner.

<Button loading>Park UI</Button>

Alternatively, you can set a custom loading text using the loadingText prop.

<Button loading loadingText="Loading...">
  Park UI
</Button>

Use the asChild prop to render the button as a link.

<Button asChild>
  <a href="https://park-ui.com" target="_blank">
    Park UI
  </a>
</Button>

Installation

npx @park-ui/cli components add button