Socket
Socket
Sign inDemoInstall

@react-types/select

Package Overview
Dependencies
Maintainers
2
Versions
730
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-types/select

Spectrum UI components in React


Version published
Weekly downloads
926K
decreased by-5.92%
Maintainers
2
Weekly downloads
 
Created

Package description

What is @react-types/select?

@react-types/select is a TypeScript type definitions package for the React Spectrum Select component. It provides type definitions for building accessible and customizable select components in React applications.

What are @react-types/select's main functionalities?

SelectProps

Defines the properties for a Select component, including label, items, and onSelectionChange handler.

import { SelectProps } from '@react-types/select';

const selectProps: SelectProps<string> = {
  label: 'Choose an option',
  items: [{ name: 'Option 1' }, { name: 'Option 2' }],
  onSelectionChange: (key) => console.log(key)
};

Item

Defines individual items within the Select component.

import { Item } from '@react-types/select';

const items = [
  <Item key="1">Option 1</Item>,
  <Item key="2">Option 2</Item>
];

Section

Defines sections within the Select component to group related items.

import { Section } from '@react-types/select';

const sections = [
  <Section title="Group 1">
    <Item key="1">Option 1</Item>
    <Item key="2">Option 2</Item>
  </Section>,
  <Section title="Group 2">
    <Item key="3">Option 3</Item>
    <Item key="4">Option 4</Item>
  </Section>
];

Other packages similar to @react-types/select

Readme

Source

@react-types/select

This package is part of react-spectrum. See the repo for more details.

FAQs

Package last updated on 09 Nov 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