3.5.0






Selectable Card

Default


Close
<div class="pb--doc-demo-row">

  <%= pb_rails("selectable_card", props: {
    input_id: "selected_with_icon",
    name: "selected_with_icon",
    value: "selected_with_icon",
    checked: true,
    icon: true
  }) do %>
    Selected, with icon
  <% end %>

  <%= pb_rails("selectable_card", props: {
    input_id: "selected_without_icon",
    name: "selected_without_icon",
    value: "selected_without_icon",
    checked: true,
  }) do %>
    Selected, without icon
  <% end %>

  <%= pb_rails("selectable_card", props: {
    input_id: "unselected",
    name: "unselected",
    value: "unselected",
  }) do %>
    Unselected
  <% end %>

  <%= pb_rails("selectable_card", props: {
    input_id: "disabled",
    name: "disabled",
    value: "disabled",
    disabled: true
  }) do %>
    Disabled
  <% end %>
  
</div>
Single Select


Close
<div class="pb--doc-demo-row">

  <%= pb_rails("selectable_card", props: {
    input_id: "male",
    name: "gender",
    value: "male",
    multi: false
  }) do %>
    Male
  <% end %>

  <%= pb_rails("selectable_card", props: {
    input_id: "female",
    name: "gender",
    value: "female",
    multi: false
  }) do %>
    Female
  <% end %>

  <%= pb_rails("selectable_card", props: {
    input_id: "other",
    name: "gender",
    value: "other",
    multi: false
  }) do %>
    Other
  <% end %>
  
</div>
Block




Close
<div class="pb--doc-demo-row">

  <%= pb_rails("selectable_card", props: {
    input_id: "block",
    name: "block",
    value: "block",
    checked: true
  }) do %>
    <%= pb_rails("title", props: { text: "Block", size: 4 }) %>
    <%= pb_rails("body", props: { tag: "span"}) do %>
      This uses block
    <% end %>
  <% end %>

  <br><br>

  <%= pb_rails("selectable_card", props: {
    input_id: "tag",
    name: "tag",
    value: "tag",
    text: "This passes in text",
    checked: false
  }) %>

</div>
Dark


Close
<div class="pb--doc-demo-row">

  <%= pb_rails("selectable_card", props: {
    input_id: "selected_with_icon_dark",
    name: "selected_with_icon_dark",
    value: "selected_with_icon_dark",
    checked: true,
    icon: true,
    dark: true
  }) do %>
    Selected, with icon
  <% end %>

  <%= pb_rails("selectable_card", props: {
    input_id: "selected_without_icon_dark",
    name: "selected_without_icon_dark",
    value: "selected_without_icon_dark",
    checked: true,
    icon: false,
    dark: true
  }) do %>
    Selected, without icon
  <% end %>

  <%= pb_rails("selectable_card", props: {
    input_id: "unselected_dark",
    name: "unselected_dark",
    value: "unselected_dark",
    checked: false,
    dark: true
  }) do %>
    Unselected
  <% end %>

  <%= pb_rails("selectable_card", props: {
    input_id: "disabled_dark",
    name: "disabled_dark",
    value: "disabled_dark",
    disabled: true,
    dark: true
  }) do %>
    Disabled
  <% end %>
  
</div>
Available Props
id
data
classname
aria
children
checked
dark
disabled
icon
multi
input_id
name
text
value