Add Drawer component for UI drawer functionality
This commit is contained in:
18
src/components/Drawer.js
Normal file
18
src/components/Drawer.js
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import { $html } from "sigpro";
|
||||||
|
import { joinClass } from "../core/utils.js";
|
||||||
|
|
||||||
|
/** DRAWER */
|
||||||
|
export const Drawer = (props) =>
|
||||||
|
$html("div", { class: joinClass("drawer", props.class) }, [
|
||||||
|
$html("input", {
|
||||||
|
id: props.id,
|
||||||
|
type: "checkbox",
|
||||||
|
class: "drawer-toggle",
|
||||||
|
checked: props.open,
|
||||||
|
}),
|
||||||
|
$html("div", { class: "drawer-content" }, props.content),
|
||||||
|
$html("div", { class: "drawer-side" }, [
|
||||||
|
$html("label", { for: props.id, class: "drawer-overlay", onclick: () => props.open?.(false) }),
|
||||||
|
$html("div", { class: "min-h-full bg-base-200 w-80" }, props.side),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
Reference in New Issue
Block a user