Socket
Book a DemoInstallSign in
Socket

@bento/field-error

Package Overview
Dependencies
Maintainers
4
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bento/field-error

The FieldError component renders error messages for form controls, such as RadioGroup or CheckboxGroup

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
4
Created
Source

import { Meta, ArgTypes, Story, Controls, Source, } from '@storybook/addon-docs/blocks';

FieldError

The @bento/field-error package provides the FieldError component, which is used to display error messages in form primitives, such as RadioGroup or CheckboxGroup. It is meant to be used in conjunction with form controls such as the RadioGroup or CheckboxGroup primitives.

Installation

npm install --save @bento/field-error

Props

The following properties are available to be used on the FieldError component:

PropTypeRequiredDescription
align"start" | "center" | "end" | "justify"NoThe alignment of the text.
asstringNoThe HTML element to render the text as.
childrenReactNodeNoThe content to display inside the text.
maxLinesnumberNoThe maximum number of lines to display.
wrap"wrap" | "nowrap" | "balance" | "pretty" | "stable"NoThe wrapping behavior of the text.
slotstringNoA named part of a component that can be customized. This is implemented by the consuming component.
The exposed slot names of a component are available in the components documentation.
slotsRecord<string, object | Function>NoAn object that contains the customizations for the slots.
The main way you interact with the slot system as a consumer.

Examples

Default

A simple usage of the FieldError component. The error message is only displayed when isInvalid is true.

import { FieldError, type FieldErrorProps } from '@bento/field-error';
/* v8 ignore next */
import React from 'react';

export function DefaultExample(args: FieldErrorProps) {
  return <FieldError {...args}>This field is required</FieldError>;
}

Keywords

accessibility

FAQs

Package last updated on 18 Dec 2025

Did you know?

Socket

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.

Install

Related posts