> This library targets ES2020+. > For older browsers (e.g. iOS 13 or IE), you will need a Polyfill such as `core-js`.
npm install cotomy> This library targets ES2020+.
> For older browsers (e.g. iOS 13 or IE), you will need a Polyfill such as core-js.
Cotomy is a lightweight framework for managing form behavior and page controllers in web applications.
It is suitable for both SPAs (Single Page Applications) and traditional web apps requiring dynamic form operations.
To install Cotomy in your project, run the following command:
``bash`
npm i cotomy
Cotomy will continue to expand with more detailed usage instructions and code examples added to the README in the future.
For the latest updates, please check the official documentation or repository regularly.
Reference: https://cotomy.net/
The View layer provides thin wrappers around DOM elements and window events.
- CotomyElement — A wrapper around HTMLElement with convenient utilities for scoped CSS, querying, attributes/styles, geometry, and event handling.CotomyMetaElement
- — Convenience wrapper for tags.CotomyWindow
- — A singleton that exposes window-level events and helpers.
- Constructor
- new CotomyElement(element: HTMLElement)new CotomyElement(html: string)
- — Creates an element from HTML (single root required)new CotomyElement({ html, css? })
- — Creates from HTML and injects scoped CSSnew CotomyElement({ tagname, text?, css? })
- scopeId: string
- Scoped CSS
- - Returns the value stored in the element's data-cotomy-scopeid attribute[root]
- placeholder in provided CSS is replaced by [data-cotomy-scopeid="..."][root]
- If no is present, [root] is treated as if it were prefixed automatically
- Scoped CSS text is kept on the instance; if the