Skip to Content

Toggle

Toggle switches are often used for settings or to show and hide UI. They utilize a slide animation to indicate switching between two opposing options.

Please note that toggle is an appearance of Camp’s checkbox component.

Overview

Set the appearance to toggle in the live demo below.

Resources

Loading...

Loading...

Loading...

Loading...

Loading...

Install

yarn add @activecampaign/camp-components-checkbox

Usage

import Checkbox from '@activecampaign/camp-components-checkbox'; export default function () { const [ checked, setChecked ] = useState(false) return ( <Checkbox appearance='toggle' checked={checked} onChange={handleChange} label="Pineapple" value="piña" /> ); function handleChange() { setChecked(!checked) } }
Last updated on