Skip to content

Commit 4761041

Browse files
committed
Add documentation note clarifying that on/off labels should only be customized when providing clearer context
1 parent 769f07e commit 4761041

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

app/components/primer/alpha/toggle_switch.rb

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,17 @@ class ToggleSwitch < Primer::Component
2929
# @param turbo [Boolean] Whether or not to request a turbo stream and render the response as such.
3030
# @param autofocus [Boolean] Whether switch should be autofocused when rendered.
3131
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
32-
# @param on_label [String] Custom label to show when switch is ON. Defaults to On.
33-
# @param off_label [String] Custom label to show when switch is OFF. Defaults to Off.
32+
# @param on_label [String] Custom label to show when the switch is ON.
33+
# Defaults to On.
34+
# Only customize this label if it makes the toggle’s state more meaningful
35+
# in its specific context. For example, for a "Show images" setting,
36+
# you might use "Hide" when the switch is ON.
37+
# @param off_label [String] Custom label to show when the switch is OFF.
38+
# Defaults to ("Off").
39+
# Only customize this label if it makes the toggle’s state more meaningful
40+
# in its specific context. For example, for a "Show images" setting,
41+
# you might use "Show" when the switch is OFF.
42+
3443
def initialize(
3544
src: nil,
3645
csrf_token: nil,

0 commit comments

Comments
 (0)