Documentation
Components
Toggle

Toggle

The Toggle component is a versatile switch that allows users to toggle between two states, such as on and off. It can be customized with different colors, sizes, and variants to fit various design needs.

Installation

Install the package

npm i @start-base/start-ui

Add the styles

To use the React form elements styles in a Next.js project, import the styles in your layout.tsx file.

app/layout.tsx
import "@start-base/start-ui/styles.css";

Import the component

import Toggle from '@start-base/start-ui/Toggle';

Usages

Default Primary Toggle

Default Destructive Toggle

Default Secondary Toggle

Outline Primary Toggle

Outline Secondary Toggle

Outline Destructive Toggle

Small Icon Toggle

Large Fluid Toggle

Disabled Primary Toggle

API

NameTypeDefaultVariantsDescription
initialStatebooleanfalseInitial state of the Toggle
colorstringprimaryprimary secondary destructiveColor of the Toggle
sizestringmediumsmall medium large iconSize of the Toggle
variantstringdefaultdefault outlineVariant of the Toggle
disabledbooleanfalseDisabled of the Toggle
classNamestringClassname of the Toggle
fluidbooleanfalseFluid of the Toggle