@thebase/ui
Version:
CDN-installable Owl and Bootstrap 5 UI component library.
87 lines (58 loc) • 2.87 kB
Markdown
Use `b-ui="message"` for a CDN-ready message component.
Load the pinned BaseUI CSS and JavaScript files; no extra dependency is required for this component.
```js
import { Message } from "@thebase/ui";
```
```base-ui
<div class="d-flex flex-column gap-3 w-100" style="max-width: 24rem">
<div class="d-flex align-items-end gap-2">
<Avatar className="'flex-shrink-0'"><t t-set-slot="fallback">JL</t></Avatar>
<Message side="'incoming'">Hey, are we still on for the deploy today?</Message>
</div>
<div class="d-flex align-items-end gap-2 justify-content-end">
<Message side="'outgoing'">Deploying to prod real quick.</Message>
<Avatar className="'flex-shrink-0'"><t t-set-slot="fallback">ME</t></Avatar>
</div>
<div class="d-flex flex-column align-items-end gap-1">
<div class="d-flex align-items-end gap-2 justify-content-end">
<Message side="'outgoing'">Just kicked it off, should be done in a few minutes.</Message>
<Avatar className="'flex-shrink-0'"><t t-set-slot="fallback">ME</t></Avatar>
</div>
<Typography variant="'muted'" className="'me-1'">Delivered</Typography>
</div>
<div class="d-flex align-items-end gap-2">
<Avatar className="'flex-shrink-0'"><t t-set-slot="fallback">JL</t></Avatar>
<Message side="'incoming'">Sounds good, keep me posted 🚀</Message>
</div>
</div>
```
| Component | Prop | Type | Notes |
| --- | --- | --- | --- |
| `Message` | `side` | `String` | optional |
| `Message` | `className` | `String` | optional |
See [Pure Owl Components](/examples/blocks.html
```base-ui
<div b-ui="message">Message</div>
```
Call `BaseUI.mount(element)` or rely on `BaseUI.mountAll()` after the script loads.
See `dist/baseui.registry.json` for the supported attribute list.
Use the global runtime methods: `BaseUI.mount()`, `BaseUI.mountAll()`, and `BaseUI.destroy()`.
Interactive components emit documented `baseui:*` events from their root element. Static components do not emit events.
The component inherits BaseUI semantic tokens such as `--b-surface`, `--b-border`, `--b-primary`, and `--b-radius`.
The component preserves authored semantic HTML and adds ARIA roles or state attributes where enhancement is required.
See `examples/index.html` for a working CDN-style page.
BaseUI targets modern evergreen browsers that support ES modules, CSS variables, and Bootstrap 5.3.
Verify light and dark themes, keyboard access for focusable controls, disabled or readonly states when applicable, and cleanup through `BaseUI.destroy()`.