Offcanvas

less than 1 minute read

References

TypeScript

import { Components } from "gd-sprest-bs";

// Create the offcanvas
let el = document.querySelector("#offcanvas");
let offcanvas = Components.Offcanvas({
    el: app,
    id: "offcanvasDemo",
    title: "Offcanvas Demo",
    body: "This is the body of the offcanvas.",
    type: Components.OffcanvasTypes.End
});

// Create the button
Components.Button({
    el: document.querySelector("#offcanvasDemo"),
    text: "Show Offcanvas",
    toggleObj: offcanvas
});

Code Playground