Skip to content

Commit 920f22f

Browse files
committed
docs(tooltip): add long content wrap example
1 parent ad1b8fe commit 920f22f

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

docs/app/views/docs/tooltip.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ def view_template
2424
RUBY
2525
end
2626

27+
render Docs::VisualCodeExample.new(title: "Long content", context: self) do
28+
<<~RUBY
29+
Tooltip do
30+
TooltipTrigger do
31+
Button(variant: :outline) { "Hover me" }
32+
end
33+
TooltipContent do
34+
Text { "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." }
35+
end
36+
end
37+
RUBY
38+
end
39+
2740
render Components::ComponentSetup::Tabs.new(component_name: component)
2841

2942
render Docs::ComponentsTable.new(component_files(component))

gem/lib/ruby_ui/tooltip/tooltip_docs.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ def view_template
2424
RUBY
2525
end
2626

27+
render Docs::VisualCodeExample.new(title: "Long content", context: self) do
28+
<<~RUBY
29+
Tooltip do
30+
TooltipTrigger do
31+
Button(variant: :outline) { "Hover me" }
32+
end
33+
TooltipContent do
34+
Text { "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." }
35+
end
36+
end
37+
RUBY
38+
end
39+
2740
render Components::ComponentSetup::Tabs.new(component_name: component)
2841

2942
render Docs::ComponentsTable.new(component_files(component))

0 commit comments

Comments
 (0)