byronwade/ui
Application UI

Forms · Application UI

Toggle

Two-state pressable toggle button with variant and size styles.

@byronwade/foundation@byronwade/utils@base-ui/reactclass-variance-authority

Feature showcase

Installation

Features

  • 6 examples

    Default, Variants, Sizes, With Text, Disabled, Controlled.

API

Props

PropTypeDefaultDescription
variant"default" | "outline""default"Visual style.
size"default" | "sm" | "lg""default"Button dimensions.
pressedboolean-Controlled pressed state.
defaultPressedboolean-Initial pressed state.

Dependencies

PackageKindDescription
@byronwade/foundationregistryInstalled through the byronwade/ui registry.
@byronwade/utilsregistryInstalled through the byronwade/ui registry.
@base-ui/reactnpmInstalled from npm.
class-variance-authoritynpmInstalled from npm.

Source and related

FilePath
Componentregistry/ui/toggle.tsx
Default examplecontent/examples/toggle/default.tsx
Variants examplecontent/examples/toggle/variants.tsx
Sizes examplecontent/examples/toggle/sizes.tsx
With Text examplecontent/examples/toggle/with-text.tsx
Disabled examplecontent/examples/toggle/disabled.tsx
Controlled examplecontent/examples/toggle/controlled.tsx