Sha256: bfd03d5a7926e5278c944710f1654eebdb94d85c468ec4a75ecaa54ee7743c80

Contents?: true

Size: 614 Bytes

Versions: 10

Compression:

Stored size: 614 Bytes

Contents

module Components::ListHelper
  def list_item(value:, name:, selected: false, as: :div)
    content_tag as, value,
      class: "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm
         outline-none aria-selected:bg-accent aria-selected:text-accent-foreground hover:bg-accent hover:text-accent-foreground
         data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
      role: "option",
      data: {value:, selected:},
      aria: {selected:}
  end

  def render_list(items, as: :div, **options)
    render "components/ui/list", items:, as:, **options
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
shadcn-ui-0.0.15 app/helpers/components/list_helper.rb
shadcn-ui-0.0.14 app/helpers/components/list_helper.rb
shadcn-ui-0.0.13 app/helpers/components/list_helper.rb
shadcn-ui-0.0.12 app/helpers/components/list_helper.rb
shadcn-ui-0.0.10 app/helpers/components/list_helper.rb
shadcn-ui-0.0.8 app/helpers/components/list_helper.rb
shadcn-ui-0.0.5 app/helpers/components/list_helper.rb
shadcn-ui-0.0.4 app/helpers/components/list_helper.rb
shadcn-ui-0.0.3 app/helpers/components/list_helper.rb
shadcn-ui-0.0.2 app/helpers/components/list_helper.rb