
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
@htmlbricks/hb-input-range
Advanced tools
Range slider (`type="range"`). Optional `params` as `InputRangeParams`: `min` / `max` may be numbers or numeric strings; each key is applied only if present on `params` (same `hasOwnProperty` pattern as number input). Coerces values for validation and nat
hb-input-rangeCategory: inputs · Tags: inputs
hb-input-range is a Bulma-styled web component that wraps a native HTML range control (type="range"). You drive it with a single JSON schemaentry attribute: bounds come from optional params.min / params.max, and the component validates against those bounds when the field is required. It emits a setVal custom event whenever the effective value or validity changes (after deduplication).
Use it when you need a string-attribute-friendly range slider that matches the same schemaentry pattern as other hb-input-* fields in forms.
| Name | Tag |
|---|---|
hb-input-range | <hb-input-range …></hb-input-range> |
Web component attributes are strings. Pass booleans as yes / no, numbers inside JSON as JSON numbers, and structured data as a JSON string on schemaentry.
| Attribute | Required | Description |
|---|---|---|
schemaentry | Yes | JSON describing the field (see below). If the attribute is missing, JSON parsing fails, or the value is null, nothing is rendered. A parsed object without id still shows the range, but setVal is not emitted. |
show_validation | No | yes or no (default in code: no). When yes, and schemaentry.validationTip is set, an invalid value shows Bulma help is-danger with that tip. |
id | No | Optional id on the host element (component typings). |
style | No | Optional inline styles on the host. |
schemaentry JSONThe attribute value is a serialized object aligned with FormSchemaEntry in types/webcomponent.type.d.ts (shared keys come from ../../form/types/webcomponent.type).
| Property | Description |
|---|---|
id | Required for setVal dispatches (the effect bails out without it). Also sets the native input id. |
value | Optional initial numeric value. Non-numeric or missing values become undefined internally. |
required | When true, the value must be set and satisfy any declared min / max (see validation). |
disabled | When true, the slider is non-interactive. |
readonly | Passed through to the native readonly attribute. |
placeholder | Passed through to the native placeholder attribute. |
validationTip | Message shown when show_validation is yes and the field is invalid. |
params | Optional InputRangeParams: slider bounds and validation limits. |
Bounds (params) — type InputRangeParams: optional min and/or max, each a number or numeric string. The implementation uses Object.prototype.hasOwnProperty.call(params, "min") (and similarly for "max"): a key must exist on params for the native min / max attributes and validation to use it. If a key is missing, that side is unconstrained.
The shared schema also allows other keys (for example label); this component does not render a label in its template—it renders the range input and optional invalid feedback only.
required is false or omitted: the component treats the field as valid (valid: true in setVal).required is true: the value must be a defined number, and:
params has a min key, value >= min (after coercion to number);params has a max key, value <= max.Invalid state uses --bulma-danger for the danger help text. The native control’s accent-color follows Bulma tokens (see Styling).
| Event | detail |
|---|---|
setVal | { value: number | undefined; valid: boolean; id: string } |
setVal is dispatched when id is present and the payload changes (value, validity, or id). Listen with addEventListener("setVal", …) in the host page or framework.
:host)Documented in extra/docs.ts (styleSetup.vars):
| Variable | Role |
|---|---|
--bulma-text | Label and current value readout color. |
--bulma-border | Track baseline color where Bulma maps borders to the range. |
--bulma-link | Native range accent-color (thumb / filled portion). In styles/webcomponent.scss, accent-color is set to var(--bulma-link, …). |
--bulma-danger | Invalid state and help is-danger when out of min / max or empty. |
--bulma-success | Valid thumb accent when show_validation marks the field as valid. |
Sass entry: styles/bulma.scss forwards Bulma form/shared, form/input-textarea, and form/tools, then applies the light theme on :host.
See Bulma CSS variables for how to set them on the host or ancestor.
| Part | Description |
|---|---|
input | The native type="range" element (class hb-input-range-native). |
invalid-feedback | The p.help.is-danger node when validation feedback is shown. |
The control is display: inline-block on :host, full width inside the host, with fixed height for the native range (styles/webcomponent.scss).
Authoring types: types/webcomponent.type.d.ts — InputRangeParams, FormSchemaEntry, Component, Events.
After npm run build:wc, generated DOM typings include hb-input-range in types/html-elements.d.ts and Svelte element typings in types/svelte-elements.d.ts.
<hb-input-range
schemaentry='{"id":"volume","required":true,"params":{"min":0,"max":100},"value":50}'
show_validation="no"
></hb-input-range>
<hb-input-range
schemaentry='{"id":"level","required":true,"params":{"min":1,"max":10},"value":1,"validationTip":"Pick a level between 1 and 10."}'
show_validation="yes"
></hb-input-range>
const el = document.querySelector("hb-input-range");
el.addEventListener("setVal", (e) => {
const { value, valid, id } = e.detail;
console.log(id, value, valid);
});
<hb-input-range
schemaentry='{"id":"volume_locked","label":"Volume","params":{"min":0,"max":100},"value":65,"disabled":true}'
></hb-input-range>
Component name in catalog setup: hb-input-range (extra/docs.ts → componentSetup). Description and Storybook-oriented examples also live in extra/docs.ts.
FAQs
Range slider (`type="range"`). Optional `params` as `InputRangeParams`: `min` / `max` may be numbers or numeric strings; each key is applied only if present on `params` (same `hasOwnProperty` pattern as number input). Coerces values for validation and nat
The npm package @htmlbricks/hb-input-range receives a total of 434 weekly downloads. As such, @htmlbricks/hb-input-range popularity was classified as not popular.
We found that @htmlbricks/hb-input-range demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.