### Install and Run Demo
Source: https://github.com/avanelsas/baredom/blob/main/bare-reagent-demo/README.md
Commands to navigate to the demo directory, install dependencies, and start the development server.
```bash
cd bare-reagent-demo
npm install
npm start # npx shadow-cljs watch app
```
--------------------------------
### Install and Run bare-node-demo
Source: https://github.com/avanelsas/baredom/blob/main/bare-node-demo/README.md
Navigate to the project directory, install dependencies, and start the development server. The application will be available at http://localhost:8003 and hot-reloads on source changes.
```bash
cd bare-node-demo
npm install
npm start
```
--------------------------------
### Run bare-node-demo with NPM
Source: https://github.com/avanelsas/baredom/blob/main/README.md
Navigate to the bare-node-demo directory, install dependencies, and start the application. Opens on http://localhost:8003.
```bash
cd bare-node-demo && npm install && npm start
```
--------------------------------
### Initialize development environment
Source: https://github.com/avanelsas/baredom/blob/main/README.md
Commands to install dependencies and start the development server for the BareDOM library.
```bash
npm install
npx shadow-cljs watch app
```
--------------------------------
### Usage Examples
Source: https://github.com/avanelsas/baredom/blob/main/docs/x-notification-center.md
Examples demonstrating how to use the x-notification-center component.
```APIDOC
## Usage Examples
### Basic push
```js
import '@vanelsas/baredom/x-alert';
import '@vanelsas/baredom/x-notification-center';
const nc = document.querySelector('x-notification-center');
nc.push({ type: 'success', text: 'File saved.' });
nc.push({ type: 'error', text: 'Network error. Please retry.' });
```
### Auto-dismiss
```js
nc.push({ type: 'info', text: 'Session expires soon.', timeoutMs: 5000 });
```
### Non-dismissible
```js
nc.push({ type: 'warning', text: 'Read-only mode.', dismissible: false });
```
### Clear all
```js
nc.clear();
```
### Listening to events
```js
nc.addEventListener('x-notification-center-push', e => {
console.log('pushed', e.detail.id, 'count:', e.detail.count);
});
nc.addEventListener('x-notification-center-dismiss', e => {
const { id, type, reason, text, count } = e.detail;
console.log(`dismissed ${id} (${type}) via ${reason} — "${text}". Remaining: ${count}`);
});
nc.addEventListener('x-notification-center-empty', () => {
console.log('All notifications cleared');
});
```
```
--------------------------------
### Install BareDOM
Source: https://context7.com/avanelsas/baredom/llms.txt
Install the library using npm.
```bash
npm install @vanelsas/baredom
```
--------------------------------
### Theming Example
Source: https://github.com/avanelsas/baredom/blob/main/docs/x-skeleton.md
Example of how to theme the x-skeleton component using CSS custom properties.
```APIDOC
## Theming
```html
```
```
--------------------------------
### Usage Examples
Source: https://github.com/avanelsas/baredom/blob/main/docs/x-pagination.md
Provides various examples of how to implement and configure the x-pagination component.
```APIDOC
## Usage Examples
### Basic Usage
```html
```
### Controlled Component (Update on Change)
This example shows how to manage the `page` attribute programmatically.
```html
```
### Custom Sibling and Boundary Counts
Adjust the number of visible pages around the current page and at the boundaries.
```html
```
### Small Size
Apply a smaller variant of the pagination component.
```html
```
### Custom Labels
Customize the text for previous and next navigation buttons, and the overall label.
```html
← PreviousNext →
```
### ESM Import
Import and initialize the component using ES Modules.
```js
import { init } from '@vanelsas/baredom/x-pagination';
init();
```
```
--------------------------------
### Basic Usage Example
Source: https://github.com/avanelsas/baredom/blob/main/docs/x-progress.md
A simple example of how to use the x-progress component with a specified value.
```html
```
--------------------------------
### Basic Navbar Example
Source: https://github.com/avanelsas/baredom/blob/main/docs/x-navbar.md
A simple example demonstrating the basic usage of the x-navbar component.
```APIDOC
## Basic Navbar Example
### Description
This example shows a functional navbar with a brand, navigation links, and action buttons.
### HTML
```html
My App
Login
```
```
--------------------------------
### Install Dependencies for Building BareDOM
Source: https://github.com/avanelsas/baredom/blob/main/README.md
Installs the necessary Node.js dependencies for building BareDOM from source.
```bash
npm install
```
--------------------------------
### Basic Usage Example
Source: https://github.com/avanelsas/baredom/blob/main/docs/x-cancel-dialogue.md
A standard configuration with a headline and message.
```html
```
--------------------------------
### x-badge Examples
Source: https://github.com/avanelsas/baredom/blob/main/docs/x-badge.md
Illustrative examples showcasing different configurations of the x-badge component.
```APIDOC
## x-badge Examples
### Description
Provides practical examples of how to use the x-badge component with various attributes.
### Method
N/A (Component Examples)
### Endpoint
N/A (Component Examples)
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- None
### Request Example
- None
### Response
#### Success Response (200)
- None
#### Response Example
- None
### Examples
#### Colour variants
```html
NeutralInfoSuccessWarningError
```
#### Count with cap
```html
```
#### Text labels
```html
```
#### Small size
```html
```
#### Dot
```html
```
#### Pill
```html
```
```
--------------------------------
### Start BareDOM Development Server
Source: https://github.com/avanelsas/baredom/blob/main/README.md
Starts the shadow-cljs development server with hot reload enabled. Access the application at http://localhost:8000.
```bash
npx shadow-cljs watch app
```
--------------------------------
### X-Dropdown Component Usage Examples
Source: https://github.com/avanelsas/baredom/blob/main/docs/x-dropdown.md
Provides various HTML and JavaScript examples demonstrating how to use the X-Dropdown component in different configurations.
```APIDOC
## X-Dropdown Component Usage Examples
### Basic Usage
```html
```
### Open by Default
```html
New fileOpen…Save
```
### Placement
```html
```
### Disabled
```html
```
### Custom Theme
```html
```
### Programmatic Control
```javascript
const dd = document.querySelector('x-dropdown');
// Open
dd.show();
// Close
dd.hide();
// Toggle
dd.toggle();
// Listen for state changes
dd.addEventListener('x-dropdown-change', e => {
console.log('open:', e.detail.open);
});
// Cancel a specific open
dd.addEventListener('x-dropdown-toggle', e => {
if (e.detail.open && someCondition) {
e.preventDefault(); // prevents opening
}
});
```
```
--------------------------------
### npm Package Installation
Source: https://github.com/avanelsas/baredom/blob/main/README.md
Add the BareDOM npm package to your `package.json` and run `npm install`.
```json
{
"dependencies": {
"@vanelsas/baredom": "^2.1.1"
}
}
```
--------------------------------
### Basic Usage
Source: https://github.com/avanelsas/baredom/blob/main/docs/x-chip.md
A basic example of how to use the x-chip component.
```APIDOC
## Basic Usage
### Description
This is a basic example of the x-chip component.
### Endpoint
N/A (Web Component)
### Parameters
N/A
### Request Example
```html
```
### Response
N/A (Web Component)
```
--------------------------------
### Usage Example
Source: https://github.com/avanelsas/baredom/blob/main/docs/x-menu.md
Demonstrates how to use the x-menu component with x-menu-item children and handle the `x-menu-select` event.
```APIDOC
## Usage
```html
EditDuplicateDelete
```
```
--------------------------------
### Basic Usage Example
Source: https://github.com/avanelsas/baredom/blob/main/docs/x-gaussian-blur.md
A standard implementation with a defined height.
```html
```
--------------------------------
### Basic Usage
Source: https://github.com/avanelsas/baredom/blob/main/docs/x-skeleton.md
Examples of using the x-skeleton component with different variants and attributes.
```APIDOC
## Basic usage
```html
```
```
--------------------------------
### Size Examples
Source: https://github.com/avanelsas/baredom/blob/main/docs/x-progress.md
Illustrates how to adjust the size of the progress bar using the 'size' attribute.
```html
```
--------------------------------
### Default slot usage
Source: https://github.com/avanelsas/baredom/blob/main/docs/x-container.md
Example of placing content inside the container.
```html
Hello world
Content goes here.
```
--------------------------------
### x-liquid-dock Usage
Source: https://github.com/avanelsas/baredom/blob/main/docs/x-liquid-dock.md
Example of how to use the x-liquid-dock component in HTML with navigation items.
```APIDOC
## Usage
```html
```
```
--------------------------------
### Usage Examples
Source: https://github.com/avanelsas/baredom/blob/main/docs/x-organic-progress.md
Demonstrates various ways to use the x-organic-progress component with different attributes and styling.
```APIDOC
### Basic (indeterminate)
```html
```
### With progress
```html
```
### Honeycomb variant, dense
```html
```
### Custom colors via CSS
```html
```
```
--------------------------------
### Basic x-context-menu Usage
Source: https://github.com/avanelsas/baredom/blob/main/docs/x-context-menu.md
A basic example of the x-context-menu component with a trigger button and menu items.
```html
Edit
Duplicate
Delete
```
--------------------------------
### Standalone with event logging
Source: https://github.com/avanelsas/baredom/blob/main/docs/x-search-field.md
Example of listening to search and clear events from the component.
```html
```
--------------------------------
### x-particle-button Usage Examples
Source: https://github.com/avanelsas/baredom/blob/main/docs/x-particle-button.md
Demonstrates how to use the x-particle-button component with different modes and variants.
```APIDOC
## Usage Examples
### Default Button
```html
Click Me
```
### Energetic Spark Button
```html
Delete
```
### Warm Ember Glow Button
```html
Proceed
```
### Full Dissolve + Reform Button
```html
Confirm
```
```
--------------------------------
### Usage Examples
Source: https://github.com/avanelsas/baredom/blob/main/docs/x-organic-divider.md
Demonstrates various ways to use the x-organic-divider component with different configurations.
```APIDOC
### Usage Examples
#### Simple wave divider
```html
```
#### Between colored sections
```html
Section One
Section Two
```
#### Flipped divider (curve points up)
```html
```
#### Multi-layer with animation
```html
```
```
--------------------------------
### Custom Theme Example
Source: https://github.com/avanelsas/baredom/blob/main/docs/x-pagination.md
Demonstrates how to customize the appearance of the x-pagination component using CSS custom properties.
```APIDOC
## Custom Theme Example
This section shows how to customize the pagination component's appearance using CSS custom properties.
### CSS Custom Properties
- `--x-pagination-button-radius`: Controls the border-radius of buttons.
- `--x-pagination-current-bg`: Background color for the current page button.
- `--x-pagination-current-color`: Text color for the current page button.
- `--x-pagination-button-hover-bg`: Background color on hover for buttons.
- `--x-pagination-button-hover-color`: Text color on hover for buttons.
### Example
```css
x-pagination {
--x-pagination-button-radius: 9999px;
--x-pagination-current-bg: #7c3aed;
--x-pagination-current-color: #fff;
--x-pagination-button-hover-bg: rgba(124, 58, 237, 0.1);
--x-pagination-button-hover-color: #7c3aed;
}
```
```
--------------------------------
### X-Drawer Component Usage
Source: https://github.com/avanelsas/baredom/blob/main/docs/x-drawer.md
Example of how to use the x-drawer component with slots for header, body, and footer.
```APIDOC
## X-Drawer Component Usage
### Description
This example demonstrates how to integrate the `x-drawer` component into your HTML, utilizing its slots for custom header, body, and footer content.
### Tag
```html
Header content
Body content goes here
Footer content
```
### Observed Attributes
| Attribute | Type | Default | Description |
|-------------|--------|------------|------------------------------------------|
| `open` | bool | absent | Shows the drawer when present |
| `placement` | enum | `"right"` | Edge: `left | right | top | bottom` |
| `label` | string | `"Drawer"` | `aria-label` for the dialog panel |
### Properties
| Property | Type | Reflects attribute |
|-------------|---------|--------------------|
| `open` | boolean | `open` |
| `placement` | string | `placement` |
| `label` | string | `label` |
### Methods
| Method | Description |
|------------|------------------------|
| `show()` | Sets `open` attribute |
| `hide()` | Removes `open` attribute |
| `toggle()` | Flips open state |
### Events
| Event | Cancelable | Detail |
|------------------|------------|--------------------------------------|
| `x-drawer-toggle` | false | `{ open: boolean }` |
| `x-drawer-dismiss` | false | `{ reason: "escape" | "backdrop" }` |
### Slots
| Slot | Description |
|------------|---------------------------------------------|
| `header` | Named — title area, close button, etc. |
| (default) | Scrollable body content |
| `footer` | Named — action buttons |
### CSS Parts
| Part | Description |
|------------|-------------------------------------|
| `backdrop` | Overlay scrim behind the panel |
| `panel` | The drawer container (dialog) |
| `header` | Header slot wrapper |
| `body` | Default slot wrapper (scrollable) |
| `footer` | Footer slot wrapper |
```
--------------------------------
### Listening to x-checkbox Change Event
Source: https://github.com/avanelsas/baredom/blob/main/docs/x-checkbox.md
Example of how to listen for the 'x-checkbox-change' event to get the new checked state and value after a change.
```javascript
document.querySelector('x-checkbox').addEventListener('x-checkbox-change', e => {
console.log('checked:', e.detail.checked, 'value:', e.detail.value);
});
```
--------------------------------
### Collapsed Docked Sidebar Example
Source: https://github.com/avanelsas/baredom/blob/main/demo/x-sidebar.html
Demonstrates a collapsed sidebar in a docked variant. This setup is useful for navigation elements that should be persistently visible but take up minimal space.
```html
...
```
--------------------------------
### Serve Project Root
Source: https://github.com/avanelsas/baredom/blob/main/bare-html/README.md
Run a static server from the project root to serve the demo. This is necessary for ES module imports to resolve correctly.
```bash
python3 -m http.server 8000
```
--------------------------------
### x-breadcrumbs Examples
Source: https://github.com/avanelsas/baredom/blob/main/docs/x-breadcrumbs.md
Various examples demonstrating the usage of the x-breadcrumbs component.
```APIDOC
## Examples
### Basic
```html
HomeProductsShoes
```
### Custom separator
```html
HomeDocsComponents
```
### Collapsed with ellipsis
```html
HomeDocsComponentsAvatarAPI
```
### Subtle variant
```html
HomeSettingsProfile
```
### ClojureScript (hiccup renderer)
```clojure
[:x-breadcrumbs {:separator "›"}
[:a {:href "/"} "Home"]
[:a {:href "/docs"} "Docs"]
[:a {:href "/docs/components"} "Components"]]
[:x-breadcrumbs {:max-items "3" :items-before "1" :items-after "2"}
[:a {:href "/"} "Home"]
[:a {:href "/docs"} "Docs"]
[:a {:href "/docs/components"} "Components"]
[:a {:href "/docs/components/avatar"} "Avatar"]
[:a {:href "/docs/components/avatar/api"} "API"]]
```
```
--------------------------------
### Vanilla HTML/JS ES Module Setup
Source: https://github.com/avanelsas/baredom/blob/main/README.md
Load BareDOM components directly using `