New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@commercetools-uikit/label

Package Overview
Dependencies
Maintainers
3
Versions
889
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commercetools-uikit/label

The Label component represents the primitive label for a form field component.

  • 19.22.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.3K
decreased by-1.09%
Maintainers
3
Weekly downloads
 
Created
Source

Forms: Label

Description

The Label component represents the primitive label for a field. It's made to be used with form fields. This component can also indicate if the field is required or not, and give emphasis by being bold.

Do's and don'ts

In order to improve readability, using inverted tone is recommended on dark backgrounds (E.g in a table header)

Usage

import Label from '@commercetools-uikit/label';
import { FormattedMessage } from 'react-intl';

const Example = () => (
  <Label isRequiredIndicatorVisible={true} isBold={false} tone="inverted">
    <FormattedMessage {...messages.title} />
  </Label>
);

export default Example;

Properties

PropsTypeRequiredValuesDefaultDescription
toneunion
Possible values:
'primary' , 'inverted'
---Indicates the tone to be applied to the label
childrenReactNode✅ (*)--Value of the label
intlMessageMessageDescriptor✅ (*)--An intl message object that will be rendered with FormattedMessage
isBoldboolean--falseIndicates if the label title should be in bold text. This prop is being deprecated in favor of the fontWeight prop
fontWeightunion
Possible values:
'medium' , 'bold'
--regularIndicates if the label title should be in medium, or bold weighted text, defaults to medium
isRequiredIndicatorVisibleboolean--falseIndicates if the labeled field is required in a form
htmlForstring---The for HTML attribute, used to reference form elements with the related attribute id or aria-labelledby.
idstring---The id HTML attribute, used to reference non-form elements with the related attribute aria-labelledby.

*: children is required only if intlMessage is not provided, and vice-versa

Keywords

FAQs

Package last updated on 27 Feb 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc