Skip to main content

Toggle

v.5.0.0

Installation

yarn add @mercell/toggle-react

Usage

Using the Toggle component is as simple as importing it like this.

import { Toggle } from '@mercell/toggle-react';
Live Editor
Result

Types, definitions, etc.

ToggleProps
interface ToggleProps {
onLabel: string;
offLabel: string;
textSide?: 'left' | 'right';
} & JSX.IntrinsicElements['input']
NameTypeDefaultRequiredDescription
onLabelstring-yesLabel for the on-position of the toggle
offLabelstring-yesLabel for the off-position of the toggle
textSide'left' /'right''rightnoPosition of label near toggle