Card
The Bootstrap card component, implemented in Ruby. Use it like any other matestack component in your apps, pages and components. It offers customizable options to simply achieve what is possible in bootstrap with this component. See below for more information about the possible options.
bs_card(*args, &block)
bs_card(*args, &block)Returns a bootstrap card containing text or content specified by a block. Also the card is customizable with the following options.
Optional options
header- Expects a string or a hash withclassandtextas possible keys, that should go inside the header componentfooter- Expects a string or a hash withclassandtextas possible keys, that should go inside the footer componentbody- Expects a string or a hash withclassandtextas possible keys, with the text that should go inside the card-body componenttitle- additional to the body text, you can add a string as title with pre-defined heading size (h5)subtitle- additional to the body text, you can add a string as subtitle with pre-defined heading size (h6)img_path- Insert an image component into the card body by giving the image pathimg_pos- Expects:bottomor:top. This parameter will set the placement of the image in the bottom of the card component. By default it's set as top imagealt_text- Expects a string for image's alt-textslots- Using slots to yield custom components in card components forheader,footerorbodyHtml attributes - all w3c confirm html attributes for div's can be set via options and will be added to the surrounding card div.
Examples
Example 1: Basic example with simple body, footer and header text
returns
Example 2: Example with body and header as a hash
returns
Example 3: Using Slots for customize card body
returns
Example 4: Using Slots for customize card header and footer
returns
Example 5: Yield a given block
Point of attention: Custom Component will be yield outside of the card-body tag.
returns
Last updated