You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@radix-ui/react-label

Package Overview
Dependencies
Maintainers
6
Versions
171
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radix-ui/react-label


Version published
Maintainers
6
Created

Package description

What is @radix-ui/react-label?

@radix-ui/react-label is a component library that provides accessible and customizable label components for React applications. It is part of the Radix UI suite, which focuses on building high-quality, accessible UI components.

What are @radix-ui/react-label's main functionalities?

Basic Label

This feature demonstrates how to use the basic Label component to associate a label with an input field using the 'htmlFor' attribute.

import { Label } from '@radix-ui/react-label';

function App() {
  return (
    <div>
      <Label htmlFor="username">Username</Label>
      <input id="username" type="text" />
    </div>
  );
}

Custom Styling

This feature shows how to apply custom styling to the Label component using a CSS class.

import { Label } from '@radix-ui/react-label';
import './App.css';

function App() {
  return (
    <div>
      <Label className="custom-label" htmlFor="email">Email</Label>
      <input id="email" type="email" />
    </div>
  );
}

Label with Description

This feature demonstrates how to include additional descriptive text within the Label component.

import { Label } from '@radix-ui/react-label';

function App() {
  return (
    <div>
      <Label htmlFor="password">
        Password
        <span className="description">(must be at least 8 characters)</span>
      </Label>
      <input id="password" type="password" />
    </div>
  );
}

Other packages similar to @radix-ui/react-label

Readme

Source

react-label

Installation

$ yarn add @radix-ui/react-label
# or
$ npm install @radix-ui/react-label

Usage

View docs here.

FAQs

Package last updated on 26 May 2023

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc