0.0.0-beta.1 • Published 7 months ago

@dataspai/ui-primitives v0.0.0-beta.1

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

dataspai Primitives

Version Downloads Discord Shield

A UI component library for building accessibile design systems & web apps.

While typically we use radix-ui primitives in our design-system, there are some missing components. To solve this issue, we work with Radix's internal packages & APIs to develop base layer primitives in a composable manor until they are (hopefully) released through Radix and we can deprecate them here.

Installation

yarn add @dataspai/ui-primitives

# or

npm i @dataspai/ui-primitives

Component Documentation

This directory shows a basic usage of the component, however for more details click on the storybook badge.

Combobox

npm.io

Basic Usage

import { Combobox } from '@dataspai/ui-primitives';

() => {
  return (
    <Combobox.Root>
      <Combobox.Trigger>
        <Combobox.TextInput placeholder="Pick me" />
        <Combobox.Icon />
      </Combobox.Trigger>
      <Combobox.Portal>
        <Combobox.Content>
          <Combobox.Viewport>
            <Combobox.Item value="1">
              <Combobox.ItemText>Option 1</Combobox.ItemText>
              <Combobox.ItemIndicator>
                <Check />
              </Combobox.ItemIndicator>
            </Combobox.Item>
            <Combobox.NoValueFound>No value found</Combobox.NoValueFound>
            <Combobox.CreateItem>Create a new value</Combobox.CreateItem>
          </Combobox.Viewport>
        </Combobox.Content>
      </Combobox.Portal>
    </Combobox.Root>
  );
};

Select

npm.io

Basic Usage

import { Select } from '@dataspai/ui-primitives';

() => {
  return (
    <Select.Root>
      <Select.Trigger>
        <Select.Value placeholder="Pick me" />
        <Select.Icon />
      </Select.Trigger>
      <Select.Portal>
        <Select.Content>
          <Select.Viewport>
            <Select.Item value="1">
              <Select.ItemText>Option 1</Select.ItemText>
              <Select.ItemIndicator>
                <Check />
              </Select.ItemIndicator>
            </Select.Item>
          </Select.Viewport>
        </Select.Content>
      </Select.Portal>
    </Select.Root>
  );
};

Contributing

Please follow our CONTRIBUTING guidelines.

License

Licensed under the MIT License, Copyright © 2022-present dataspai Solutions SAS.

See LICENSE for more information.