JSPM

  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q41704F
  • License MIT

Select component for real system.

Package Exports

  • @real-system/select
  • @real-system/select/lib/index.esm.js
  • @real-system/select/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@real-system/select) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@real-system/select

Select component for real system.

npm version

Installation

# install peer dependencies

# npm
$ npm install react react-dom @real-system/ariakit-library @real-system/elements-primitive @real-system/styled-library @real-system/utils-library
# yarn
$ yarn add react react-dom @real-system/ariakit-library @real-system/elements-primitive @real-system/styled-library @real-system/utils-library

# install select

# npm
$ npm install @real-system/select
# yarn
$ yarn add @real-system/select

Code Example

import {
  Select,
  SelectContainer,
  SelectGroup,
  SelectGroupLabel,
  SelectItem,
  SelectSeparator,
} from '@real-system/select';
import { Text } from '@real-system/typography';

const DefaultSelect = (args) => {
  return (
    <Select label="Select a fruit" maxW="20rem">
      <SelectItem value="Apple" />
      <SelectItem value="Grape" disabled />
      <SelectItem value="Melon" />
    </Select>
  );
};

const SelctGroupExample = (args) => {
  return (
    <Select label="Select a fruit" maxW="20rem">
      <SelectGroup>
        <SelectGroupLabel>Fruits</SelectGroupLabel>
        <SelectItem value="Apple" />
        <SelectItem value="Grape" disabled />
        <SelectItem value="Melon" />
      </SelectGroup>
      <SelectSeparator />
      <SelectGroup>
        <SelectGroupLabel>Vegatables</SelectGroupLabel>
        <SelectItem value="Lettuce" />
        <SelectItem value="Pepper" disabled />
        <SelectItem value="Onion" />
      </SelectGroup>
    </Select>
  );
};