No description
  • JavaScript 56.6%
  • TypeScript 42%
  • Dockerfile 1.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Marie Lucca 8d97dab513
Merge pull request #100 from github/dependabot/npm_and_yarn/npm_and_yarn-b448f38fe0
Bump ws from 8.17.1 to 8.21.1 in the npm_and_yarn group across 1 directory
2026-07-15 21:53:29 -04:00
.devcontainer Add a .devcontainer 2022-02-28 17:04:57 +00:00
.github/workflows Update publish.yml 2026-05-08 13:25:03 -07:00
examples Implement strikethrough 2021-02-09 16:45:24 -05:00
src fix clicking on inner elements in button 2024-03-01 17:41:34 +00:00
test Remove chromium npm package; use system Chrome for tests 2026-03-13 20:11:55 +00:00
.eslintrc.json Ignore ESLint rules in test file 2022-01-04 09:39:15 +00:00
.gitignore Initial commit with the basics 2018-06-19 15:41:49 -07:00
CODEOWNERS move AOR to primer 2022-09-23 18:44:30 +01:00
LICENSE Initial commit with the basics 2018-06-19 15:41:49 -07:00
package-lock.json Bump ws in the npm_and_yarn group across 1 directory 2026-07-16 00:39:49 +00:00
package.json Remove chromium npm package; use system Chrome for tests 2026-03-13 20:11:55 +00:00
README.md docs: clarify focus management in readme 2020-04-02 10:40:04 +01:00
tsconfig.json Apply suggestions from code review 2020-05-20 13:43:17 -04:00

<markdown-toolbar> element

Markdown formatting buttons for text inputs.

Installation

$ npm install --save @github/markdown-toolbar-element

Usage

import '@github/markdown-toolbar-element'
<markdown-toolbar for="textarea_id">
  <md-bold>bold</md-bold>
  <md-header>header</md-header>
  <md-italic>italic</md-italic>
  <md-quote>quote</md-quote>
  <md-code>code</md-code>
  <md-link>link</md-link>
  <md-image>image</md-image>
  <md-unordered-list>unordered-list</md-unordered-list>
  <md-ordered-list>ordered-list</md-ordered-list>
  <md-task-list>task-list</md-task-list>
  <md-mention>mention</md-mention>
  <md-ref>ref</md-ref>
  <button data-md-button>Custom button</button>
</markdown-toolbar>
<textarea id="textarea_id"></textarea>

<markdown-toolbar> comes with focus management as advised in WAI-ARIA Authoring Practices 1.1: Toolbar Design Pattern. The md-* buttons that ship with this package are automatically managed. Add a data-md-button attribute to any custom toolbar items to enroll them into focus management.

Browser support

Browsers without native custom element support require a polyfill.

  • Chrome
  • Firefox
  • Safari
  • Microsoft Edge

Development

npm install
npm test

License

Distributed under the MIT license. See LICENSE for details.