JSPM

react-aria

0.5.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1061161
  • Score
    100M100P100Q172691F
  • License MIT

Utilities to help create React ARIA components.

Package Exports

  • react-aria

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 (react-aria) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

React ARIA

npm version Dependency Status

Utilities to help compose ARIA compliant components.

Usage

npm install react-aria --save

<script src="https://unpkg.com/react-aria/dist/react-aria.js"></script>
(UMD library exposed as `ReactARIA`)

Example

import { AriaManager, AriaToggle, AriaPopover, AriaItem } from 'react-aria'

class Dropdown extends Component {
  state = {
    selection: null
  }

  _handleSelection = (value, e) => {
    this.setState({ selection: value })
  }

  render() {
    return (
      <AriaManager onItemSelection={this._handleSelection}>
        { isOpen =>
          <div>
            <AriaToggle>
              {this.state.selection || 'Select A Dropdown Item'}
            </AriaToggle>
            { isOpen &&
              <AriaPopover role="menu">
                <AriaItem>Apples</AriaItem>
                <AriaItem>Pears</AriaItem>
                <AriaItem>Oranges</AriaItem>
              </AriaPopover>
            }
          </div>
        }
      </AriaManager>
    )
  }
}

Running Locally

clone repo

git clone git@github.com:souporserious/react-aria.git

move into folder

cd ~/react-aria

install dependencies

npm install

run dev mode

npm run dev

open your browser and visit: http://localhost:8080/

Thank You

Huge thank you to David Clark and all of his ARIA work. Most of the code in here is heavily inspired by what he has done.