Reach UI is an accessible foundation for React applications and design systems.
The three equally important goals are to be:
- Accessible
- Composable
- Stylable
import { riff, route, html, indexRoute } from "../riff/riff.mjs"; | |
import { serve } from "../riff/riff-express.mjs"; | |
import { | |
deleteTask, | |
getProjects, | |
getTasks, | |
getUser, | |
sendEmail, | |
updateTask, | |
createTask, |
import invariant from "tiny-invariant"; | |
class AmalgoBox extends HTMLElement { | |
get input() { | |
return this.querySelector("input") as HTMLInputElement; | |
} | |
get button() { | |
return this.querySelector("button") as HTMLButtonElement; | |
} |
//////////////////////////////////////////////////////////////////////////////// | |
// Create a directory called "pages" next to | |
// this file, put markdown files in there, and | |
// then run: | |
// | |
// ``` | |
// $ node build.mjs | |
// ``` | |
// | |
// Then deploy the "build" directory somewhere. |
import React, { useState, useEffect } from "react"; | |
import "./packages/combobox/styles.css"; | |
import { | |
Combobox, | |
ComboboxInput, | |
ComboboxList, | |
ComboboxOption, | |
ComboboxPopup | |
} from "./packages/combobox/index"; |
///////////////////////////////// | |
import React from "react" | |
import ReactDOM from 'react-dom' | |
let reducer = (state={count: 0}, action) => { | |
if (action.type === 'up') { | |
return { | |
...state, | |
count: state.count + 1 | |
} |
javascript:(function(){if(window._activeElInterval){clearInterval(window._activeElInterval);delete window._activeElInterval;}else{var activeEl;window._activeElInterval=setInterval(function(){var currentActiveEl=document.activeElement;if(currentActiveEl!==activeEl){activeEl=currentActiveEl;console.log(activeEl);}},200);}})(); |
// This is an example of how to fetch external data in response to updated props, | |
// If you are using an async mechanism that does not support cancellation (e.g. a Promise). | |
class ExampleComponent extends React.Component { | |
_currentId = null; | |
state = { | |
externalData: null | |
}; |
{ | |
"emojis": [ | |
{"emoji": "👩👩👧👧", "name": "family: woman, woman, girl, girl", "shortname": ":woman_woman_girl_girl:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F467", "html": "👩‍👩‍👧‍👧", "category": "People & Body (family)", "order": ""}, | |
{"emoji": "👩👩👧👦", "name": "family: woman, woman, girl, boy", "shortname": ":woman_woman_girl_boy:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F466", "html": "👩‍👩‍👧‍👦", "category": "People & Body (family)", "order": ""}, | |
{"emoji": "👩👩👦👦", "name": "family: woman, woman, boy, boy", "shortname": ":woman_woman_boy_boy:", "unicode": "1F469 200D 1F469 200D 1F466 200D 1F466", "html": "👩‍👩‍👦‍👦", "category": "People & Body (family)", "order": ""}, | |
{"emoji": "👨👩👧👧", "name": "family: man, woman, girl, girl", "shortname": ":man_woman_girl_girl:", "unicode": "1F468 200D 1F469 200D 1F467 200D 1F467", "html": "👨‍👩&z |
const fetch = (url) => { | |
return new Promise((resolve, reject) => { | |
setTimeout(() => { | |
console.log(url) | |
switch(url.match(/\d[aA-zZ]$/)[0]) { | |
case "1a": | |
resolve({name: "Seb"}) | |
// or try this instead: | |
// reject({error: "something went wrong while fetching " + url}) | |
break; |