Button Card Data List Detail Disclosure Divider Field Set Icon Button Icon Icon Select Inline Text Field Label Link Link Select Menu Modal Rich Text Box Section Select Tabs Tag Text Text Field Text Field With Prefix Toggle

Dimsum v2.0.0

An agentic component library for Ruby On Rails.

toggle.html.erb Copy snippet Copied!
1
<%= render ToggleComponent.new(label: "Label", info: true, disabled: true) %>

Toggle

A switch (track + thumb) with an optional label — a real checkbox in forms, or an `<a role="switch">` link for Turbo-driven view swaps.

Checked
Info
Disabled
PropTypeDefault
checked On (ON track green, thumb shifted right). Boolean false
label Optional text after the switch, rendered as a LabelComponent; nil → switch only. String nil
info Passed to the Label — shows its trailing info icon. Boolean false
href When present, renders an `<a role="switch">` link instead of a checkbox. String nil
name Checkbox `name` (form mode only). String nil
disabled Disables the control (dims it, no interaction). Boolean false
**html_options Extra HTML attributes on the root (data-*, aria-*, …). Hash —

Contains

  • Label