Documentation
Components
ToggleGroup

ToggleGroup

The ToggleGroup component is a flexible UI element that enables users to switch between multiple options or states. It supports customization in terms of colors, sizes, and variants, making it adaptable to different design requirements.

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 ToggleGroup from '@start-base/start-ui/ToggleGroup';

Usages

Default Toggle Group

Default Destructive Toggle

Outline Style Toggle Group

Large Size Toggle Group

API

NameTypeDefaultVariantsDescription
initialStatebooleanfalseInitial state of the Toggle
sizestringmediumlarge medium smallSize of the Toggle
variantstringdefaultdefault outlineVariant of the Toggle
colorstringprimaryprimary secondary destructiveColor of the Toggle
valuestringValue of the Toggle
disabledbooleanfalseDisabled of the Toggle
childrennodeChildren of the Toggle