summary refs log tree commit diff stats
path: root/src/components/container.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/components/container.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/components/container.rs b/src/components/container.rs
new file mode 100644
index 0000000..cf7aa5a
--- /dev/null
+++ b/src/components/container.rs
@@ -0,0 +1,34 @@
+use leptos::{
+    IntoView, component,
+    prelude::{Children, ClassAttribute, ElementChild},
+    view,
+};
+use leptos_meta::Style;
+
+#[component]
+pub fn Container(header: impl IntoView, children: Children) -> impl IntoView {
+    view! {
+        <Style>
+            "
+            .rocie-container {
+                border-width: 0.1rem;
+                border-style: solid;
+                border-color: gray;
+                border-radius: 15%;
+
+                padding: 0.2rem;
+
+                text-align: left;
+            }
+            .rocie-container-header {
+                font-size: 1.5rem;
+            }
+            "
+        </Style>
+
+        <div class="rocie-container">
+            <p class="rocie-container-header">{header}</p>
+            {children()}
+        </div>
+    }
+}