Sha256: ad8aad6ad1dbe19107ff27d34e87e07d5e0b3e700bab65a684ffa7dbe5828179
Contents?: true
Size: 1.3 KB
Versions: 7
Compression:
Stored size: 1.3 KB
Contents
# frozen_string_literal: true module Primer module Beta # @label Details class DetailsPreview < ViewComponent::Preview # @label Default options # # @param overlay [Symbol] select [none, default, dark] # @param reset [Boolean] toggle def default(reset: false, overlay: :default) render Primer::Beta::Details.new(reset: reset, overlay: overlay) do |c| c.with_summary do "Summary" end c.with_body do "Body" end end end # @label Custom button # # @param overlay [Symbol] select [none, default, dark] # @param reset [Boolean] toggle def custom_button(reset: false, overlay: :default) render Primer::Beta::Details.new(reset: reset, overlay: overlay) do |c| c.summary(size: :small, scheme: :primary) { "Click me" } c.body { "Body" } end end # @label Without button # # @param overlay [Symbol] select [none, default, dark] # @param reset [Boolean] toggle def without_button(reset: false, overlay: :default) render Primer::Beta::Details.new(reset: reset, overlay: overlay) do |c| c.summary(button: false) { "Click me" } c.body { "Body" } end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems