### Toast from Template Examples Source: https://github.com/knadh/oat/blob/master/docs/content/components/toast.md Demonstrates using `ot.toast.el` with a pre-defined template, showing variations in duration and placement. ```javascript ot.toast.el(document.querySelector('#my-template')) ot.toast.el(document.querySelector('#my-template'), { duration: 8000, placement: 'bottom-center' }) ``` -------------------------------- ### Install Oat via npm Source: https://github.com/knadh/oat/blob/master/docs/content/usage.md Install the Oat package using npm and import its CSS and JS files into your project. ```bash npm install @knadh/oat ``` ```js import '@knadh/oat/oat.min.css'; import '@knadh/oat/oat.min.js'; ``` -------------------------------- ### Responsive Grid Layout Example Source: https://github.com/knadh/oat/blob/master/docs/content/components/grid.md Demonstrates various column and offset configurations within a 12-column grid system. Use `.col-{n}` for width and `.offset-{n}` for spacing. ```html
col-4
col-4
col-4
col-6
col-6
col-3
col-6
col-3
col-4 offset-2
col-4
col-8
col-3 offset-1
col-3
col-4 col-end
``` -------------------------------- ### Basic Spinner Examples Source: https://github.com/knadh/oat/blob/master/docs/content/components/spinner.md Use `aria-busy="true"` to show a loading indicator. Customize size with `data-spinner="small|large"`. ```html
``` -------------------------------- ### Input Group Examples Source: https://github.com/knadh/oat/blob/master/docs/content/components/form.md Shows how to group inputs with buttons or labels using the `.group` class on a `
`. ```html
https://
``` -------------------------------- ### Default Oat Brown Theme Example Source: https://github.com/knadh/oat/blob/master/docs/content/customizing.md An example of overriding theme variables to create a specific color profile, in this case, a brown theme. ```css --background: #fff; --foreground: #09090b; --card: #fff; --card-foreground: #09090b; --primary: #574747; --primary-foreground: #fafafa; --secondary: #f4f4f5; --secondary-foreground: #574747; --muted: #f4f4f5; --muted-foreground: #71717a; --faint: #fafafa; --accent: #f4f4f5; --danger: #df514c; --danger-foreground: #fafafa; --success: #4caf50; --success-foreground: #fafafa; --warning: #ff8c00; --warning-foreground: #09090b; --border: #d4d4d8; --input: #d4d4d8; --ring: #574747; ``` -------------------------------- ### API Webhook POST Request Example Source: https://github.com/knadh/oat/blob/master/docs/templates/demo.html Example of how to send a POST request to a webhook endpoint using curl. Requires an Authorization header with a Bearer token. ```bash curl -X POST https://api.example.com/webhooks \ -H "Authorization: Bearer TOKEN" ``` -------------------------------- ### JavaScript Code Block Example Source: https://github.com/knadh/oat/blob/master/docs/content/components/typography.md An example of a JavaScript function within a preformatted code block. This demonstrates how code is displayed when using the pre and code tags. ```javascript function hello() { console.log('Hello, World!'); } ``` -------------------------------- ### Skeleton Card Layout Source: https://github.com/knadh/oat/blob/master/docs/content/components/skeleton.md To achieve a card layout with skeleton loaders, place the skeleton elements inside an `
` tag. This example shows a card with an image placeholder and two text placeholders. ```html
``` -------------------------------- ### Badge Variants and Styles Source: https://github.com/knadh/oat/blob/master/docs/content/components/badge.md Use the `.badge` class with `data-variant` attribute for different color options. The `.outline` class can be added for an outlined style. No specific setup or imports are required beyond including the Oat UI CSS. ```html Default Secondary Outline Success Warning Danger ``` -------------------------------- ### Basic Skeleton Loaders Source: https://github.com/knadh/oat/blob/master/docs/content/components/skeleton.md Use the `.skeleton` class with `role="status"` for loading placeholders. Apply `.line` for text or `.box` for images. ```html
``` -------------------------------- ### Basic Dialog Structure Source: https://github.com/knadh/oat/blob/master/docs/content/components/dialog.md Use `commandfor` and `command="show-modal"` on a button to open a target dialog. The dialog can be closed by any interaction outside of it or by pressing Escape. ```html

Title

This is a dialog description.

Dialog content goes here. You can put any HTML inside.

Click outside or press Escape to close.

``` -------------------------------- ### Set Demo Theme with Local Storage Source: https://github.com/knadh/oat/blob/master/docs/templates/demo.html Applies a theme to the demo page and persists the selection in local storage. Handles the 'default' theme by removing the attribute. ```javascript function setDemoTheme(theme) { if (theme === 'default') { document.documentElement.removeAttribute('data-demo-theme'); } else { document.documentElement.setAttribute('data-demo-theme', theme); } localStorage.setItem('demo-theme', theme); // document.getElementById('theme-menu').hidePopover(); } setDemoTheme(localStorage.getItem('demo-theme') || 'default'); ``` -------------------------------- ### Toast Placement Options Source: https://github.com/knadh/oat/blob/master/docs/content/components/toast.md Illustrates the different screen positions available for toast notifications. ```APIDOC ## Toast Placement ### Description Specifies the screen position where the toast notification will appear. ### Method `ot.toast(message, title?, options?) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```js ot.toast('Top left', '', { placement: 'top-left' }) ot.toast('Top center', '',{ placement: 'top-center' }) ot.toast('Top right', '',{ placement: 'top-right' }) // default ot.toast('Bottom left', '', { placement: 'bottom-left' }) ot.toast('Bottom center', '', { placement: 'bottom-center' }) ot.toast('Bottom right', '',{ placement: 'bottom-right' }) ``` ### Response #### Success Response (200) None (Toast is a UI element) #### Response Example None ``` -------------------------------- ### Download Oat files Source: https://github.com/knadh/oat/blob/master/docs/content/usage.md Download the minified CSS and JavaScript files for Oat using wget. These files can then be included in your project locally. ```shell wget https://raw.githubusercontent.com/knadh/oat/refs/heads/gh-pages/oat.min.css wget https://raw.githubusercontent.com/knadh/oat/refs/heads/gh-pages/oat.min.js ``` ```html ``` -------------------------------- ### Basic Form Elements Source: https://github.com/knadh/oat/blob/master/docs/content/components/form.md Demonstrates various standard HTML form elements styled automatically. Ensure inputs are wrapped in `