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

@lmvz-ds/react

v0.42.2

Published

Readme

React Components

This is the React wrapper library generated from the LMVZ-DS Components package via Stencil.

Package Layout

This package provides:

  • Auto-generated React wrappers for all LMVZ components (in lib/components/generated/, do not edit)
  • Re-exported utilities from @lmvz-ds/components/public-utils

Build

Always build via Turbo from the repository root to compile TypeScript and generate the distribution bundle:

pnpm exec turbo run build --filter=@lmvz-ds/react

Usage

Import components from @lmvz-ds/react and render them as JSX:

import React from 'react';
import { LmvzButton, LmvzSelect } from '@lmvz-ds/react';

export function MyComponent() {
  const [selected, setSelected] = React.useState<string | undefined>();

  return (
    <>
      <LmvzButton variant="primary">Click me</LmvzButton>
      <LmvzSelect
        label="Choose one"
        value={selected}
        onLmvzChange={(e) => setSelected(e.detail)}
      >
        <option value="">-- Select --</option>
        <option value="ch">Switzerland</option>
        <option value="de">Germany</option>
      </LmvzSelect>
    </>
  );
}

Event Handling

Stencil's React output target wraps custom component events as camelCased React props. A component's @Event emitter (e.g., lmvzChange) becomes an onLmvzChange prop:

| Component Event | React Prop | Event Detail | | ---------------------- | --------------- | ------------------------------------------------- | | @Event() lmvzChange | onLmvzChange | Component-specific payload (check component docs) | | @Event() actionClick | onActionClick | MouseEvent | | @Event() lmvzSubmit | onLmvzSubmit | Form-related data |

Event handlers receive a synthetic event object with a detail property containing the custom event payload:

<LmvzSelect onLmvzChange={(event) => console.log(event.detail)}>
  {/* ... */}
</LmvzSelect>

Note: These are not React's SyntheticEvent instances — they are wrapper objects around native DOM events. For advanced use cases, access the underlying DOM event via event.nativeEvent if needed.

lmvz-select Value Handling

Value Type

The value and values props control which option is selected:

  • Single-select mode (multiple false or unset): bind to value (string or null)
  • Multiselect mode (multiple true): bind to values (string[])
// Single-select
const [selected, setSelected] = React.useState<string | null>(null);
<LmvzSelect value={selected} onLmvzChange={(e) => setSelected(e.detail)}>

// Multiselect
const [selected, setSelected] = React.useState<string[]>([]);
<LmvzSelect multiple values={selected} onLmvzChange={(e) => setSelected(e.detail)}>

Property Binding for values (Multiselect)

The values prop is a JS property only, and thus not attribute-reflected. JSX property binding (which Stencil's React output target handles correctly) works as expected:

// ✓ Correct: property binding
<LmvzSelect multiple values={selectedValues} />

// ✓ Also correct: controlled component pattern
const [selected, setSelected] = React.useState<string[]>(['ch']);
<LmvzSelect
  multiple
  values={selected}
  onLmvzChange={(e) => setSelected(e.detail)}
/>

Unlike template-driven frameworks, JSX always binds via properties, so the property-only nature of values is transparent to React consumers.

Runtime multiple Mode Switching

Toggling the multiple prop at runtime is an app-level responsibility. The component does not automatically reset its value when switching modes. When you toggle multiple:

  1. The previously-active value (now in the inactive field) is ignored.
  2. You must explicitly reset the value to match the new mode's shape:
const [multiple, setMultiple] = React.useState(false);
const [selected, setSelected] = React.useState<string | string[] | null>(null);

const handleModeToggle = () => {
  const newMultiple = !multiple;
  setMultiple(newMultiple);

  // Reset value to match the new mode
  if (newMultiple) {
    // Single → multi: wrap in array
    setSelected(typeof selected === 'string' ? [selected] : []);
  } else {
    // Multi → single: unwrap first element
    setSelected(Array.isArray(selected) ? (selected[0] ?? null) : null);
  }
};

Auto-Generated Files (Do Not Edit)

  • lib/components/generated/** — all files in this directory are auto-generated by Stencil's React output target during @lmvz-ds/components production build
  • Manual edits will be silently overwritten on the next build

Further Help

For more information on React and JSX patterns, see the React documentation.

For component-specific API details, refer to the component documentation in the published design system or the component source file's JSDoc comments.