
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
An appealing prototypical GUI for controlling your Web-App, JSON or JavaScript Object Values
<ctrl-ing>
is a tiny HTML custom element used to interactively control your Web-App parameters or JavaScript/JSON/DOM object values in a comfortable way with the following characteristics:
25.3/14.2 kB
un/compressed.The interactive menu on the right side of Figure 1 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: 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>
menu and is associated to either
All section objects are generating plain native HTML (form) elements in the background (shadow DOM). That markup is hidden and separated from other code on the page — thus avoiding code collisions.
Help for getting started and a complete documentation containing an interactive reference is available.
Run | Source | Example |
---|---|---|
API | source | Using the API |
array | source | Controlling an array object |
autogenerate | source | Automatically generating a menu |
color | source | Controlling an RGB color |
demo | source | Showing all features |
lissajous | source | Lissajous App |
minimal | source | Minimal menu generation |
parse-error | source | Treating JSON parse error |
paths | source | Using paths as JSONPath strings |
self | source | Controlling the menu itself |
svg | source | Controlling SVG graphics |
todeg | source | Transform property with user setting |
variable | source | Controlling a single variable value |
vector | source | Controlling multiple values as vector |
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
var
, since let
and const
variables aren't accessible using globalThis
or window
object, which is used here for global variables. No restriction for objects or arrays though.ctrl-variable.html
for an example.ctrl-array.html
for an example.callback
function for setting value only.ctrl-todeg.html
for an example.ctrling
serves my personal needs very well as it is.num
section removed.ctrling
is licensed under the MIT License
FAQs
An appealing prototypical GUI for controlling your Web-App, JSON or JavaScript Object Values
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
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.