Skip to main content

Button (Item)

Example

import { components } from "replugged";
const { ButtonItem } = components;

<ButtonItem button="Button text" onClick={() => console.log("Pressed!")}>
Title
</ButtonItem>;

Subcomponents

ComponentDescription
Button.LinkButton link with React Router

Enums

EnumDescription
Button.BorderColorsButton border colors
BRAND | RED | GREEN | YELLOW | PRIMARY | LINK | WHITE | BLACK | TRANSPARENT | BRAND_NEW
Button.ColorsButton colors
BRAND | RED | GREEN | YELLOW | PRIMARY | LINK | WHITE | BLACK | TRANSPARENT | BRAND_NEW | CUSTOM
Button.HoversButton color hovers
DEFAULT | BRAND | RED | GREEN | YELLOW | PRIMARY | LINK | WHITE | BLACK | TRANSPARENT
Button.LooksButton styles
FILLED | INVERTED | OUTLINED | LINK | BLANK
Button.SizesButton sizes
NONE | TINY | SMALL | MEDIUM | LARGE | XLARGE | MIN | MAX | ICON

Props

info

The props of this component extend the attributes of the button element.

NameTypeDefaultDescription
borderColorButton.BorderColorsButton border color
buttonstringButton text for the item component
buttonRefRef<HTMLButtonElement>Button ref
colorButton.ColorsButton.Colors.BRANDButton color
focusPropsRecord<string, unknown>Props for the FocusRing component
fullWidthbooleanfalseWhether the button width is at maximum
growbooleantrueWhether the button size can grow
hideBorderbooleanfalseWhether a divider is not displayed at the end of the button item
hoverButton.HoversButton hover color
innerClassNamestringText element class name
lookButton.LooksButton.Looks.FILLEDButton style
notestringDescription of what the button item is about
sizeButton.SizesButton.Sizes.MEDIUMButton size
submittingbooleanfalseWhether to display a loader inside the button; works together with disabled set to false
submittingFinishedLabelstringLoading finishedAnnounce finish loading message for screen-reader users; works together with submitting
submittingStartedLabelstringLoadingAnnounce start loading message for screen-reader users; works together with submitting
successbooleanfalseWhether the button color is green
tooltipPositionTooltip.PositionsTooltip position displayed on the button item
tooltipTextstringTooltip text displayed on the button item
wrapperClassNamestringWrapper element class name

Types

Props:

info

The props of this component extend the props of React Router DOM's Link component.

NameTypeDefaultDescription
borderColorButton.BorderColorsButton border color
colorButton.ColorsButton.Colors.BRANDButton color
fullWidthbooleanfalseWhether the button width is at maximum
growbooleantrueWhether the button size can grow
hoverButton.HoversButton hover color
innerClassNamestringText element class name
lookButton.LooksButton.Looks.FILLEDButton style
sizeButton.SizesButton.Sizes.MEDIUMButton size