about summary refs log tree commit diff stats
path: root/components
diff options
context:
space:
mode:
Diffstat (limited to 'components')
-rw-r--r--components/attributes_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/components/attributes_test.go b/components/attributes_test.go
index bf3e93b..9de0604 100644
--- a/components/attributes_test.go
+++ b/components/attributes_test.go
@@ -1,6 +1,7 @@
 package components_test
 
 import (
+	"os"
 	"testing"
 
 	g "github.com/maragudk/gomponents"
@@ -30,3 +31,9 @@ func TestClasses(t *testing.T) {
 		}
 	})
 }
+
+func ExampleClasses() {
+	e := g.El("div", c.Classes{"party-hat": true, "boring-hat": false})
+	_ = e.Render(os.Stdout)
+	// Output: <div class="party-hat"></div>
+}