Skip to content

Commit 43d78aa

Browse files
committed
Add documentation
1 parent f5cf8f6 commit 43d78aa

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

app/components/flowbite/link.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# frozen_string_literal: true
22

33
module Flowbite
4+
# The link component can be used to set hyperlinks from one page to another or
5+
# to an external website when clicking on an inline text item, button, or card
6+
#
7+
# Use this component to add default styles to an inline link element.
48
class Link < ViewComponent::Base
59
attr_reader :href, :options
610

@@ -10,6 +14,13 @@ def classes
1014
end
1115
end
1216

17+
# Initialize the Link component.
18+
#
19+
# @param href What to link to. This can be a String or anything else that
20+
# `link_to` supports. See `ActionView::Helpers::UrlHelper#link_to` for more
21+
# details.
22+
#
23+
# @param options [Hash] Additional HTML options for the link element
1324
def initialize(href:, **options)
1425
super()
1526
@href = href

0 commit comments

Comments
 (0)