Toggle
Preview Toggle, copy setup snippets, review examples, and inspect API exports for @tuturuuu/ui/toggle.
Preview
A contained preview using the same shared primitive exported by the package.
Installation
Install the shared UI package, import global styles once, then import the component from its public subpath.
bun add @tuturuuu/uiimport '@tuturuuu/ui/globals.css';import { Toggle, toggleVariants } from '@tuturuuu/ui/toggle';Usage
Copy the default usage snippet and adapt labels, state, and event handlers to the product surface.
import { Toggle } from '@tuturuuu/ui/toggle';
<Toggle aria-label="Toggle bold">B</Toggle>Examples
Examples reuse the registry snippets so the docs stay aligned with the component catalog.
Default
A minimal implementation using the current registry snippet.
import { Toggle } from '@tuturuuu/ui/toggle';
<Toggle aria-label="Toggle bold">B</Toggle>Composition
Use the grouped exports when the primitive has slots, triggers, content regions, or providers.
import {
Toggle,
toggleVariants,
} from '@tuturuuu/ui/toggle';Package import
Import through the public package path so workspace and external apps share the same contract.
// Public package import
import { Toggle } from '@tuturuuu/ui/toggle';
// Workspace apps should keep importing through the package boundary.API reference
The public exports currently available from this component entry.
| Name | Kind | Description |
|---|---|---|
Toggle | Component | Toggle is exported from @tuturuuu/ui/toggle. Inspect the source for component-specific props and composition details. |
toggleVariants | Helper | toggleVariants is exported from @tuturuuu/ui/toggle. Inspect the source for component-specific props and composition details. |
Customization
Common props, states, and composition points to review before using this component.