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

@xsolla/xui-field-group

v0.104.0

Published

A cross-platform React wrapper component that adds consistent labeling, required indicators, helper text, and spacing to form fields.

Readme

Field Group

A cross-platform React wrapper component that adds consistent labeling, required indicators, helper text, and spacing to form fields.

Installation

npm install @xsolla/xui-field-group
# or
yarn add @xsolla/xui-field-group

Demo

Basic Field Group

import * as React from 'react';
import { FieldGroup } from '@xsolla/xui-field-group';
import { Input } from '@xsolla/xui-input';

export default function BasicFieldGroup() {
  return (
    <FieldGroup label="Username">
      <Input placeholder="Enter username" />
    </FieldGroup>
  );
}

Required Field

import * as React from 'react';
import { FieldGroup } from '@xsolla/xui-field-group';
import { Input } from '@xsolla/xui-input';

export default function RequiredField() {
  return (
    <FieldGroup label="Email" required>
      <Input type="email" placeholder="Enter email" />
    </FieldGroup>
  );
}

With Helper Text

import * as React from 'react';
import { FieldGroup } from '@xsolla/xui-field-group';
import { Input } from '@xsolla/xui-input';

export default function HelperField() {
  return (
    <FieldGroup
      label="Password"
      helper="Must be at least 8 characters"
    >
      <Input type="password" placeholder="Enter password" />
    </FieldGroup>
  );
}

With Icon

import * as React from 'react';
import { FieldGroup } from '@xsolla/xui-field-group';
import { Input } from '@xsolla/xui-input';
import { Info } from '@xsolla/xui-icons-base';

export default function IconField() {
  return (
    <FieldGroup
      label="API Key"
      icon={<Info />}
    >
      <Input placeholder="Enter API key" />
    </FieldGroup>
  );
}

Anatomy

import { FieldGroup } from '@xsolla/xui-field-group';

<FieldGroup
  label="Field Label"          // Label text
  required={false}             // Show required asterisk
  helper="Helper text"         // Helper text below field
  icon={<Icon />}              // Icon next to label
  size="md"                    // Size variant
  marginBottom={16}            // Bottom margin (spacing)
  htmlFor="field-id"           // Associate with form field
>
  <FormField />                // Form control component
</FieldGroup>

Examples

Form with Field Groups

import * as React from 'react';
import { FieldGroup } from '@xsolla/xui-field-group';
import { Input } from '@xsolla/xui-input';
import { Select } from '@xsolla/xui-select';
import { Textarea } from '@xsolla/xui-textarea';
import { Button } from '@xsolla/xui-button';

export default function CompleteForm() {
  return (
    <div style={{ maxWidth: 400 }}>
      <FieldGroup label="Full Name" required>
        <Input placeholder="John Doe" />
      </FieldGroup>
      <FieldGroup label="Email" required helper="We'll never share your email">
        <Input type="email" placeholder="[email protected]" />
      </FieldGroup>
      <FieldGroup label="Country">
        <Select
          options={['United States', 'Canada', 'United Kingdom']}
          placeholder="Select country"
        />
      </FieldGroup>
      <FieldGroup label="Bio" helper="Max 500 characters">
        <Textarea placeholder="Tell us about yourself" />
      </FieldGroup>
      <FieldGroup marginBottom={0}>
        <Button>Submit</Button>
      </FieldGroup>
    </div>
  );
}

Field Group Sizes

import * as React from 'react';
import { FieldGroup } from '@xsolla/xui-field-group';
import { Input } from '@xsolla/xui-input';

export default function FieldGroupSizes() {
  return (
    <div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
      <FieldGroup size="sm" label="Small Field" required helper="Small helper">
        <Input size="sm" placeholder="Small input" />
      </FieldGroup>
      <FieldGroup size="md" label="Medium Field" required helper="Medium helper">
        <Input size="md" placeholder="Medium input" />
      </FieldGroup>
      <FieldGroup size="lg" label="Large Field" required helper="Large helper">
        <Input size="lg" placeholder="Large input" />
      </FieldGroup>
    </div>
  );
}

API Reference

FieldGroup

FieldGroup Props:

| Prop | Type | Default | Description | | :--- | :--- | :------ | :---------- | | children | ReactNode | - | Form field component. | | label | string | - | Label text. | | required | boolean | false | Show required asterisk (*). | | helper | string | - | Helper text below field. | | icon | ReactElement | - | Icon next to label. | | size | "sm" \| "md" \| "lg" | "md" | Size variant. | | marginBottom | number | Based on size | Bottom margin for spacing. | | htmlFor | string | - | Associate label with field by ID. | | data-testid | string | - | Test identifier. |

Size Specifications

| Size | Label Font | Label Line Height | Helper Font | Margin Bottom | | :--- | :--------- | :---------------- | :---------- | :------------ | | sm | 10px | 16px | 12px | 8px | | md | 12px | 20px | 12px | 16px | | lg | 14px | 24px | 12px | 24px |

Behavior

  • Required asterisk (*) appears before label in red
  • Icon appears after label with appropriate spacing
  • Helper text appears below the field content
  • Consistent vertical rhythm with configurable margins