![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
An appealing prototypical GUI for controlling your Web-App, JSON or JavaScript Object Values
ctrling
ctrl-ing
is a tiny HTML custom element used to interactively control your Web-App parameters or JavaScript/JSON object values in a comfortable way with the following characteristics:
18.7/11.3 kB
un/compressed.The interactive menu for this example was created via:
<ctrl-ing ref="app" darkmode>
[ {"sec":"hdr","text":"Parameters"},
{"sec":"num","label":"a","min":0,"max":10,"step":1,"path":"$['a']","unit":"[-]"},
{"sec":"num","label":"b","min":0,"max":10,"step":1,"path":"$['b']","unit":"[-]"},
{"sec":"hdr","text":"Animation"},
{"sec":"chk","label":"run","path":"$['run']"},
{"sec":"rng","label":"vel","min":1,"max":10,"step":1,"path":"$['vel']"},
{"sec":"hdr","text":"Style"},
{"sec":"col","label":"Stroke","path":"$['ls']"},
{"sec":"col","label":"Fill","path":"$['fs']"}
]
</ctrl-ing>
Listing 1: Structure of custom HTML element ctrl-ing
.Beside implementing your web application, all you need to do for prototyping an appealing GUI, is inserting a <ctrl-ing>
element to your HTML document (see Listing 1). Its content is compact JSON text, representing an array of section objects. Each section corresponds to a single line in the grid-like view structure of the <ctrl-ing>
element's shadow DOM and is associated to either
All section objects are generating plain native HTML (form) elements in the background (shadow DOM).
Let's start with a minimal example resulting in this controlling menu.
<ctrl-ing>
Example.Here is the complete HTML code.
<!doctype html>
<html>
<head>
<meta charset='utf-8'>
<title>Getting Started</title>
<script src="https://cdn.jsdelivr.net/npm/ctrling/ctrling.min.js"></script>
</head>
<body>
<ctrl-ing ref="obj" autoupdate>
[ {"sec":"hdr","text":"Getting Started"},
{"sec":"chk","label":"Toggle","path":"$['toggle']"},
{"sec":"out","label":"obj=","path":"$"}
]
</ctrl-ing>
<script>
const obj = {
toggle: false
}
</script>
</body>
</html>
Listing 2: Minimalistic example using <ctrl-ing>
element.With this example please take note of following points:
ref="obj"
attribute the <ctrl-ing>
instance references a global object obj
.chk
section in the JSON content accesses the toggle
member of the reference object obj
via its path
property using standard JSONPath syntax, where the root identifier "$"
corresponds to the ref
attribute content above.out
section is monitoring the reference object in JSON text format.autoupdate
attribute of the <ctrl-ing>
instance enables monitoring sections to be updated automatically.ctrling.js
is inserted via CDN to the page.The generated encapsulated shadow DOM structure for this example is quite clear.
<main>
<section class="hdr">Getting Started</section>
<section class="chk">
<label>Toggle<input type="checkbox"></label>
</section>
<section class="out">
obj=<span><output>{
"toggle":false
}</output></span>
</section>
</main>
<ctrl-ing>
ElementThe default width of the <ctrl-ing>
menu is 200px
, which can be modified by the element's width
attribute. Its default position is the top right corner of the HTML page. This might be fine-adjusted via top
and right
attributes.
We can use multiple <ctrl-ing>
s per page. In this case the elements should be encapsulated via
<div style="position:relative;">
<ctrl-ing>...</ctrl-ing>
</div>
If the <ctrl-ing>
element should be positioned side-by-side with another element – which is frequently the case, the following markup might be used
<div style="display:flex; position:relative;">
<div>...</div>
<ctrl-ing>...</ctrl-ing>
</div>
Following attributes are supported:
Attribute | Default | Meaning |
---|---|---|
ref | window | Referencing a global object variable of the name indicated by this attribute. |
width | 200px | Width of the GUI menu. |
top | 0 | Distance relative to top edge of parent element. |
right | 0 | Distance relative to right edge of parent element. |
darkmode | - | Display GUI menu in dark mode. |
autoupdate | - | Automatically update monitoring sections. |
tickspersecond | 4 | How often updating monitoring sections per second. |
callback | - | If present, will be called with each value change of input sections. The attribute value must obey the JSONPath syntax rules and might be a global function or an object method. |
Use a local instance or one of the following CDN links for ctrling.js
.
https://cdn.jsdelivr.net/npm/ctrling/ctrling.js
https://cdn.jsdelivr.net/npm/ctrling/ctrling.min.js
ctrling
is licensed under the MIT License
FAQs
An appealing prototypical GUI for controlling your Web-App, JSON or JavaScript Object Values
The npm package ctrling receives a total of 9 weekly downloads. As such, ctrling popularity was classified as not popular.
We found that ctrling demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.