2025-04-30 18:14:22 -04:00
|
|
|
class LinkComponentPreview < ViewComponent::Preview
|
|
|
|
# Usage
|
|
|
|
# -------------
|
|
|
|
#
|
2025-07-18 08:30:00 -04:00
|
|
|
# DS::Link is a small abstraction on top of the `link_to` helper.
|
2025-04-30 18:14:22 -04:00
|
|
|
#
|
2025-07-18 08:30:00 -04:00
|
|
|
# It can be used as a regular link or styled as a "Link button" using any of the available DS::Button variants.
|
2025-04-30 18:14:22 -04:00
|
|
|
#
|
2025-07-18 08:30:00 -04:00
|
|
|
# @param variant select {{ DS::Link::VARIANTS.keys }}
|
|
|
|
# @param size select {{ DS::Link::SIZES.keys }}
|
2025-04-30 18:14:22 -04:00
|
|
|
# @param icon select ["", "plus", "arrow-right"]
|
|
|
|
# @param icon_position select ["left", "right"]
|
|
|
|
# @param full_width toggle
|
|
|
|
def default(variant: "default", size: "md", icon: "plus", icon_position: "left", full_width: false)
|
2025-07-18 08:30:00 -04:00
|
|
|
render DS::Link.new(
|
2025-04-30 18:14:22 -04:00
|
|
|
href: "#",
|
|
|
|
text: "Preview link",
|
|
|
|
variant: variant,
|
|
|
|
size: size,
|
|
|
|
icon: icon,
|
|
|
|
icon_position: icon_position,
|
|
|
|
full_width: full_width
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|