Skip to content
Snippets Groups Projects

Replace deprecated slot setters

Merged Thomas Hutterer requested to merge thutterer/view_component_slot_setter_8 into master
1 file
+ 0
23
Compare changes
  • Side-by-side
  • Inline
# frozen_string_literal: true
module Pajamas
class CheckboxTagComponentPreview < ViewComponent::Preview
# @param name text
# @param checked toggle
# @param value text
def default(name: "my-checkbox-tag", checked: true, value: '1')
render(Pajamas::CheckboxTagComponent.new(
name: name,
checked: checked,
value: value
)) do |c|
c.with_label do
"Label text is a #{content_tag(:em, 'slot')}.".html_safe
end
c.with_help_text do
"The help text is a slot, too."
end
end
end
end
end
Loading