This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source https://www.patterns.dev/posts/import-on-interaction | |
import React, { useState, createElement } from "react"; | |
import MessageList from "./MessageList"; | |
import MessageInput from "./MessageInput"; | |
import ErrorBoundary from "./ErrorBoundary"; | |
const Channel = () => { | |
const [emojiPickerEl, setEmojiPickerEl] = useState(null); | |
const openEmojiPicker = () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function useLogCount(msg) { | |
const count = useRef(1); | |
useEffect(() => { | |
console.debug(msg, count.current); | |
count.current++; | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="email" name="email" id="email" aria-invalid="true" aria-errormessage="err1" /> | |
<span id="err1">error: Enter a valid email address</span> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<FormattedMessage | |
id="foo" | |
defaultMessage="To buy a shoe, <a>visit our website</a> and <cta>buy a shoe</cta>" | |
values={{ | |
a: chunks => ( | |
<a | |
class="external_link" | |
target="_blank" | |
href="https://www.example.com/shoe" | |
> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog --> | |
<dialog open> | |
<p>Greetings, one and all!</p> | |
<!-- method="dialog" closes dialog on form submit --> | |
<form method="dialog"> | |
<button>OK</button> | |
</form> | |
</dialog> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- https://scottaohara.github.io/landmarks_demo/ --> | |
<!DOCTYPE html> | |
<html lang="en-us" class="no-js"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Landmarks Demonstration</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<script> | |
// remove no-js and add 'js' to the HTML | |
document.documentElement.className = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- https://www.w3.org/WAI/tutorials/forms/notifications/ --> | |
<!-- Use notifications to provide user feedback after a user action --> | |
<!-- 1. Using main heading --> | |
<h1>3 Errors - Billing Address</h1> | |
<h1>Thank you for submitting your order.</h1> | |
<!-- 2. Using page title --> | |
<title>3 Errors - Billing Address</title> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- https://www.w3.org/WAI/tutorials/forms/labels/ --> | |
<!-- simple labels --> | |
<label for="firstname">First name:</label> | |
<input type="text" name="firstname" id="firstname" /> | |
<!-- Cases where label text is hidden --> | |
<!-- Hide label text with CSS --> | |
<style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress#accessibility_concerns --> | |
<!-- OPTION A --> | |
<label | |
>Uploading Document: <progress value="70" max="100">70 %</progress></label | |
> | |
<!-- OPTION B --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/optgroup --> | |
<label for="dino-select">Choose a dinosaur:</label> | |
<select id="dino-select"> | |
<optgroup label="Theropods"> | |
<option>Tyrannosaurus</option> | |
<option>Velociraptor</option> | |
<option>Deinonychus</option> | |
</optgroup> | |
<optgroup label="Sauropods"> |
NewerOlder