@pikas-ui/button

This package contains a button components and a button link components.

Change Log

Requirements

To use this package, you must install the @pikas-ui/styles package.

Installation

You can install this package using npm, yarn, or pnpm.

npm install @pikas-ui/button
yarn add @pikas-ui/button
pnpm add @pikas-ui/button

Usage

Button

This component is a button component that can be used to trigger an action. You can put an icon inside the button using the LeftIcon or RightIcon props.

import { Button } from '@pikas-ui/button';

const Example: React.FC = () => <Button>Click me</Button>;

Props

Props extends ButtonHTMLAttributes<HTMLButtonElement>

PropDescriptionTypeDefault
childrenThe content of the button.ReactNode-
typeThe type of the button.ButtonTarget"button"
colorNameThe color of the button.PikasColors"primary"
colorHexThe color of the button (hex).string-
contentColorNameThe color of the content of the button.PikasColors-
contentColorHexThe color of the content of the button (hex).string-
cssThe css of the button.ButtonCSS-
paddingThe padding of the button.ButtonPadding"md"
loadingIf the button is loading.booleanfalse
disabledIf the button is disabled.booleanfalse
borderRadiusThe border radius of the button.PikasRadius"md"
fontSizeThe font size of the button.PikasFontSize"em-base"
textTransformThe text transform of the button.ButtonTextTransform"default"
fontWeightThe font weight of the button.PikasFontWeight"normal"
effectThe effect of the button when hovered or clicked.ButtonEffect"opacity"
onClickThe function to call on click.function-
gapThe gap of the button.ButtonGap"md"
LeftIconThe left icon of the button.FC<IconProps>-
RightIconThe right icon of the button.FC<IconProps>-
outlinedIf the button is outlined.booleanfalse
borderWidthThe border width of the button.number2
widthThe width of the button.string or number"100%"
maxWidthThe max width of the button.string or number"100%"
minWidthThe min width of the button.string or number-
boxShadowThe box shadow of the button.PikasShadow or 'none""bottom-sm"

ButtonLink

This component is a button link component that can be used to trigger an action. You can put an icon inside the button using the LeftIcon or RightIcon props.

import { ButtonLink } from '@pikas-ui/button';

const Example: React.FC = () => <ButtonLink href="#">Click me</ButtonLink>;

Props

Props extends AnchorHTMLAttributes<HTMLAnchorElement>

PropDescriptionTypeDefault
childrenThe content of the button.ReactNode-
colorNameThe color of the button.PikasColors"primary"
colorHexThe color of the button (hex).string-
contentColorNameThe color of the content of the button.PikasColors-
contentColorHexThe color of the content of the button (hex).string-
cssThe css of the button.ButtonCSS-
paddingThe padding of the button.ButtonPadding"md"
loadingIf the button is loading.booleanfalse
disabledIf the button is disabled.booleanfalse
borderRadiusThe border radius of the button.PikasRadius"md"
fontSizeThe font size of the button.PikasFontSize"em-base"
textTransformThe text transform of the button.ButtonTextTransform"default"
fontWeightThe font weight of the button.PikasFontWeight"normal"
effectThe effect of the button when hovered or clicked.ButtonEffect"opacity"
onClickThe function to call on click.function-
gapThe gap of the button.ButtonGap"md"
hrefThe href of the button.string-
LeftIconThe left icon of the button.FC<IconProps>-
RightIconThe right icon of the button.FC<IconProps>-
outlinedIf the button is outlined.booleanfalse
borderWidthThe border width of the button.number2
targetThe target of the button.ButtonTarget"_self"
widthThe width of the button.string or number"100%"
maxWidthThe max width of the button.string or number"100%"
minWidthThe min width of the button.string or number-
boxShadowThe box shadow of the button.PikasShadow or 'none""bottom-sm"

ButtonIcon

This component is a button icon component that can be used to trigger an action.

import { ButtonIcon } from '@pikas-ui/button';
import { IconProps, IconByName } from '@pikas-ui/icons';

const IconExample: React.FC<IconProps> = (props) => {
  return <IconByName {...props} name="bx:baguette" />;
};

const Example: React.FC = () => <ButtonIcon icon={IconExample} />;

Props

Props extends ButtonHTMLAttributes<HTMLButtonElement>

PropDescriptionTypeDefault
typeThe type of the button.ButtonTarget"button"
colorNameThe color of the button.PikasColors"primary"
colorHexThe color of the button (hex).string-
contentColorNameThe color of the content of the button.PikasColors-
contentColorHexThe color of the content of the button (hex).string-
cssThe css of the button.ButtonCSS-
paddingThe padding of the button.ButtonPadding"md"
loadingIf the button is loading.booleanfalse
disabledIf the button is disabled.booleanfalse
borderRadiusThe border radius of the button.PikasRadius"md"
effectThe effect of the button when hovered or clicked.ButtonEffect"opacity"
onClickThe function to call on click.function-
outlinedIf the button is outlined.booleanfalse
borderWidthThe border width of the button.number2
sizeThe size of the button.Sizes24
boxShadowThe box shadow of the button.PikasShadow or 'none""bottom-sm"

ButtonIconLink

This component is a button icon link component that can be used to trigger an action.

import { ButtonIconLink } from '@pikas-ui/button';
import { IconProps, IconByName } from '@pikas-ui/icons';

const IconExample: React.FC<IconProps> = (props) => {
  return <IconByName {...props} name="bx:baguette" />;
};

const Example: React.FC = () => <ButtonIconLink icon={IconExample} href="#" />;

Props

Props extends AnchorHTMLAttributes<HTMLAnchorElement>

PropDescriptionTypeDefault
colorNameThe color of the button.PikasColors"primary"
colorHexThe color of the button (hex).string-
contentColorNameThe color of the content of the button.PikasColors-
contentColorHexThe color of the content of the button (hex).string-
cssThe css of the button.ButtonCSS-
paddingThe padding of the button.ButtonPadding"md"
loadingIf the button is loading.booleanfalse
disabledIf the button is disabled.booleanfalse
borderRadiusThe border radius of the button.PikasRadius"md"
effectThe effect of the button when hovered or clicked.ButtonEffect"opacity"
onClickThe function to call on click.function-
hrefThe href of the button.string-
outlinedIf the button is outlined.booleanfalse
borderWidthThe border width of the button.number2
sizeThe size of the button.Sizes6
targetThe target of the button.ButtonTarget"_self"
boxShadowThe box shadow of the button.PikasShadow or 'none""bottom-sm"

Contributing

This documentation can be edited on GitHub here