Skip to main content
VelinStyle v1.3.0
⌂ Home

HTML attributes 1.2.2

Add velin-* attributes in HTML; the framework interprets them and lazy-loads Web Components or CSS — no duplicate implementations. Deutsch: HTML-Attribute Leitfaden

Maturity: Documented as stable in VelinStyle 1.2.0. Design Intelligence (plan / review / agent meta) is separate and beta / foundation where noted.

When to use

When not

Boot

import { bootFromDOM } from '@birdapi/velinstyle';
import { registerAttribute, listRegisteredAttributes } from '@birdapi/velinstyle/attributes';

registerAttribute('velin-my-widget', {
  enhance(el) {
    el.setAttribute('data-velin-component', 'velin-my-widget');
  },
});

await bootFromDOM(document, { attributes: true });
console.log(listRegisteredAttributes());

Bridge model

bootAttributes() scans for registered attribute names, runs enhance(el) once per element, then initMotion() and ensures a global <velin-announcer> when needed. Register custom handlers with registerAttribute(name, { enhance }). 27 attributes are built in (see generated reference).

Motion attributes

Component bridges

AttributeLoads
velin-modal<velin-modal>
velin-tabs<velin-tabs>
velin-accordion<velin-accordion>
velin-tooltip="text"<velin-tooltip>
velin-copy="text"<velin-copy>
velin-counter<velin-counter>
velin-notifyToast via velin-toast-show event
velin-themedata-velin-theme or <velin-theme-toggle>
velin-progress.velin-progress or ring with ring
velin-search<velin-search>
velin-scroll-top<velin-scroll-top> (threshold from attribute value)

Content helpers

Declarative scroll-to-top

Add velin-scroll-top on <body> or any element — no extra markup. Works with bootFromDOM(document, { attributes: true }):

<body velin-scroll-top="400">
  ...
</body>

See also Scroll to top component.

Generated docs

Per-attribute Markdown is generated by velinstyle docs generate into docs/generated/attributes/ (including velin-scroll-top.md). Sync to this site with npm run sync:generated.