BetaPublic beta — Read the release notes
Documentation

Toggle

A two-state button that can be toggled on or off.

Package
@solidiom/toggle
Version
0.0.1-next.0
Status
stable

Generated from the package's public source.

API

Rootcomponent

                        Root(props: ToggleRootProps): Element
                      

Props

class?
string
defaultPressed?
boolean — Default pressed state (uncontrolled).
disabled?
boolean — Whether the toggle is disabled.
onPressedChange?
(pressed: boolean) => void — Called when pressed state changes.
pressed?
Accessor<boolean | undefined> — Controlled pressed state.
style?
string | CSSProperties

children: Element

View source

ToggleRootPropsinterface

Props

class?
string
defaultPressed?
boolean — Default pressed state (uncontrolled).
disabled?
boolean — Whether the toggle is disabled.
onPressedChange?
(pressed: boolean) => void — Called when pressed state changes.
pressed?
Accessor<boolean | undefined> — Controlled pressed state.
style?
string | CSSProperties

children: Element

View source