Giter Site home page Giter Site logo

so99ynoodles / headless-react Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 454 KB

Headless UI using React Aria and React Stately

Home Page: https://www.npmjs.com/org/headless-react

License: Apache License 2.0

CSS 10.69% JavaScript 4.79% TypeScript 84.20% HTML 0.32%
react-aria react-stately

headless-react's Introduction

headless-react

Headless React components with @react-aria and @react-stately.

Motivation

react-aria and react-stately provide great APIs but they are hard to use between projects to projects and difficult to learn / implement complex components with them. Providing headless-ui like APIs would be helpful.

CAUTION: THIS IS AN UNSTABLE PROJECT FOR THE PERSONAL USE. USE IT AT YOUR OWN RISK.

Getting Started

$ npm install @headless-react/combobox
import { ComboBox } from '@headless-react/combobox'

const AutoComplete = ({
  label,
  items
}) => {

  return (
    <ComboBox defaultItems={items}>
      <ComboBox.Label>{label}</ComboBox.Label>
      <ComboBox.InputGroup>
        {({ selectedItem }) => (
          <>
            <ComboBox.Input />
            <ComboBox.PopoverTrigger>
          </>
        )}
      </ComboBox.InputGroup>
      <ComboBox.Popover>
        <ComboBox.Options>
          {({ options }) => options.map(option => (
            <ComboBox.Option key={option.key} option={option}>
              {option.name}
            </ComboBox.Option>
          ))}
        </ComboBox.Options>
      </ComboBox.Popover>
    </ComboBox>
  )
}

Components

  • Button
  • ComboBox
    • Single
    • Multi
  • Select
    • Single
    • Multi
  • Menu
  • RadioGroup

...something I need

Examples on CodeSandBox

headless-react's People

Contributors

so99ynoodles avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.