dev.metalisp.sbt/src/component/card.lisp

19 lines
807 B
Common Lisp
Raw Normal View History

2023-07-07 19:37:58 +02:00
;; https://getbootstrap.com/docs/5.3/components/card/
;; A card is a flexible and extensible content container. It includes options for
;; headers and footers, a wide variety of content, contextual background colors,
;; and powerful display options. If youre familiar with Bootstrap 3, cards
;; replace our old panels, wells, and thumbnails. Similar functionality to those
;; components is available as modifier classes for cards.
(in-package :cl-sbt)
(defmacro card ((&key (img-src nil) (btn-txt nil)) &body body)
`(spinneret:with-html
(:div :class "card"
,(when img-src `(:img :class "card-img-top" :src ,img-src))
(:div :class "card-body"
(:p :class "card-text"
,@body)
,(when btn-txt `(btn-primary ,btn-txt))))))