We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d29fac6 commit 8be3d4fCopy full SHA for 8be3d4f
lib/ruby_ui/skeleton/skeleton.rb
@@ -0,0 +1,17 @@
1
+# frozen_string_literal: true
2
+
3
+module RubyUI
4
+ class Skeleton < Base
5
+ def view_template(&)
6
+ div(**attrs, &)
7
+ end
8
9
+ private
10
11
+ def default_attrs
12
+ {
13
+ class: "animate-pulse rounded-md bg-primary/10"
14
+ }
15
16
17
+end
test/ruby_ui/skeleton_test.rb
@@ -0,0 +1,15 @@
+require "test_helper"
+class RubyUI::SkeletonTest < ComponentTest
+ def test_render
+ output = phlex do
+ RubyUI::Skeleton(class: "w-14 h-14")
+ assert_match(/div/, output)
+ assert_match(/w-14/, output)
+ assert_match(/h-14/, output)
0 commit comments