npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@htmlbricks/hb-input-area

v0.73.7

Published

Bulma `textarea` + validation modifiers and `help is-danger`. `schemaentry` matches the shared form shape (`FormSchemaEntryShared` + control fields): `id`, optional `label`, `value`, `placeholder`, `readonly`, `disabled`, `required`, `validationRegex`, `v

Readme

hb-input-area

Category: inputs · Tags: inputs · Package: @htmlbricks/hb-input-area

Summary

Bulma textarea in the shadow root, driven by schemaentry (same shape as hb-form rows). Emits setVal and clickEnter (Enter without Shift).

Typings: InputAreaParams, FormSchemaEntry, Component, Events in types/webcomponent.type.d.ts.

Behavior

  • Rendering: If schemaentry is missing, invalid JSON, or otherwise unparsable, the component renders nothing until a valid object is provided.
  • Value sync: When the fingerprint of schemaentry changes, the textarea value is reset from schemaentry.value when that property is present; otherwise the value becomes an empty string.
  • Live updates: The component dispatches setVal whenever value, valid, or the field id changes (and redundant identical payloads are skipped). The field must have an id for setVal to be emitted.
  • Enter key: Enter without Shift prevents the default newline and dispatches clickEnter. Shift+Enter keeps default behavior so users can insert line breaks.
  • Optional label: The shared schema type allows label, but this web component’s markup does not render a separate label element; use your host page or a wrapping layout for captions if you need a visible title.

Validation rules

Validation affects the valid flag in events and, when show_validation="yes" and the field is required, the is-success / is-danger classes on the textarea and the optional invalid-feedback part.

| Mode | valid | | --- | --- | | No parsed field | false | | required: true and empty value | false | | required: true with non-empty value | true only if validationRegex matches (when set), length ≥ params.min (when set), and length ≤ params.max (when set) | | required not set or required: false | Always true (regex and min / max are not applied in this branch) |

params.min and params.max are inclusive character counts on the current string value.

Styling

The shadow tree loads Bulma 1.x form modules (including textarea-related pieces) via styles/bulma.scss. Theme the control with --bulma-* custom properties on :host (see Bulma CSS variables).

CSS custom properties

| Variable | Role | | --- | --- | | --bulma-primary | Focus ring and valid-state accents | | --bulma-danger | Invalid border and danger help text | | --bulma-border | Default textarea border | | --bulma-text | Text color inside the control | | --bulma-radius | Corner radius |

CSS parts

| Part | Target | | --- | --- | | input | The <textarea> element | | invalid-feedback | The help is-danger line shown when validation feedback is enabled and the value is invalid |

Slots

This component does not declare any slots.

Custom element

hb-input-area

Attributes (snake_case)

Web component attributes are strings. Booleans use yes / no. Complex objects must be JSON strings (escape quotes correctly in HTML).

| Attribute | Required | Description | | --- | --- | --- | | schemaentry | Yes | JSON string (HTML) or object (JS); see below. | | show_validation | No | "yes" or "no" (default no). When "yes" and the field is required, invalid state shows danger styling and validationTip under the textarea when invalid. | | id | No | Optional host id string (component props typing). | | style | No | Optional inline style string (component props typing). |

schemaentry JSON shape

The payload follows FormSchemaEntryShared (from hb-form typings) with params narrowed to InputAreaParams for this control.

Commonly used keys

| Key | Description | | --- | --- | | id | Required. Field identifier; also used in event payloads. | | type | Optional discriminator for form rows; may be omitted when the tag already implies a textarea. | | label | Optional; not rendered by this component’s template. | | value | Optional initial content (coerced with String(...)). | | placeholder | Optional placeholder text. | | readonly | Optional boolean in JSON. | | disabled | Optional boolean in JSON. | | required | Optional boolean in JSON. | | validationRegex | Optional string; compiled with new RegExp(...). | | validationTip | Optional message shown in the danger help line when invalid and show_validation is enabled. | | dependencies | Optional; carried in the shared schema type for form use cases. | | params | Optional InputAreaParams: min / max inclusive length bounds (numbers in JSON). |

Events

Listen with addEventListener or framework equivalents on the host element.

| Event | detail | | --- | --- | | setVal | { value: string; valid: boolean; id: string } | | clickEnter | { value: string; valid: boolean; id?: string } |

Usage examples

Minimal host markup

<hb-input-area
  schemaentry="{&quot;id&quot;:&quot;notes&quot;,&quot;label&quot;:&quot;Notes&quot;,&quot;placeholder&quot;:&quot;Type here…&quot;}"
  show_validation="no"
></hb-input-area>

Required field with visible validation

<hb-input-area
  schemaentry="{&quot;id&quot;:&quot;notes&quot;,&quot;required&quot;:true,&quot;placeholder&quot;:&quot;Notes (required)&quot;,&quot;validationTip&quot;:&quot;Please enter at least a few characters.&quot;}"
  show_validation="yes"
></hb-input-area>

Length bounds (required field)

<hb-input-area
  schemaentry="{&quot;id&quot;:&quot;bio&quot;,&quot;required&quot;:true,&quot;params&quot;:{&quot;min&quot;:10,&quot;max&quot;:500},&quot;validationTip&quot;:&quot;10–500 characters.&quot;}"
  show_validation="yes"
></hb-input-area>

Listening from JavaScript

const el = document.querySelector("hb-input-area");

el.addEventListener("setVal", (e) => {
  const { value, valid, id } = e.detail;
  console.log(id, valid, value);
});

el.addEventListener("clickEnter", (e) => {
  const { value, valid, id } = e.detail;
  console.log("enter", id, valid, value);
});

TypeScript

types/webcomponent.type.d.tsschemaentry is typed as string | FormSchemaEntry | undefined for HTML vs JS consumers.

Integration with hb-form

schemaentry matches the shared form row shape so the same JSON you would use in a form schema (for an area / textarea row) can be passed into this standalone control. Coordinate id with your surrounding form state and use setVal to keep parent models in sync.