Skip to main content

Checkbox (Item)

Example

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

export function Settings(): React.ReactElement {
return <CheckboxItem {...util.useSetting(cfg, "foo", "bar")}>Checkbox title</CheckboxItem>;
}

Enums

EnumDescription
Checkbox.AlignsCheckbox alignments
TOP | CENTER
Checkbox.ShapesCheckbox shapes
BOX | ROUND | SMALL
Checkbox.TypesCheckbox types
DEFAULT | INVERTED | GHOST | ROW

Props

NameTypeDefaultDescription
alignCheckbox.AlignsCheckbox.Aligns.CENTERAlignment of the elements inside the checkbox
checkboxColorstringCheckbox border color
classNamestringComponent class name
colorstringvar(--brand-500)Checkbox color; variable name must be used with the var() function
disabledbooleanfalseWhether the checkbox is disabled
displayOnlybooleanfalseWhether the checkbox is a static element
innerClassNamestringCheckbox element class name
onChange(event: ChangeEvent<HTMLInputElement>, value: boolean) => voidFunction ran on value change
onClickMouseEventHandler<HTMLInputElement>Function ran on checkbox click
readOnlybooleanfalseWhether the checkbox is read only
reversebooleanfalseWhether the checkbox position is on the right side
shapeCheckbox.ShapesCheckbox.Shapes.BOXDefine checkbox shape
sizenumber24Checkbox width and height
styleCSSPropertiesComponent style
typeCheckbox.TypesCheckbox.Types.DEFAULTDefine checkbox type
valuebooleanfalseCheckbox state