All Projects → juliankrispel → React Text Selection Popover

juliankrispel / React Text Selection Popover

Selection based Text UI made easy

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to React Text Selection Popover

bangle.dev
Collection of higher level rich text editing tools. It powers the local only note taking app https://bangle.io
Stars: ✭ 541 (+120.82%)
Mutual labels:  text-editor, rich-text-editor, wysiwyg-editor
Angular Froala Wysiwyg
Angular 4, 5, 6, 7, 8 and 9 plugin for Froala WYSIWYG HTML Rich Text Editor.
Stars: ✭ 696 (+184.08%)
Mutual labels:  text-editor, rich-text-editor, wysiwyg-editor
Megadraft
Megadraft is a Rich Text editor built on top of Facebook's Draft.JS featuring a nice default base of components and extensibility
Stars: ✭ 982 (+300.82%)
Mutual labels:  rich-text-editor, draft-js, wysiwyg-editor
Pell
📝 the simplest and smallest WYSIWYG text editor for web, with no dependencies
Stars: ✭ 11,653 (+4656.33%)
Mutual labels:  text-editor, rich-text-editor, wysiwyg-editor
am-editor
A rich text collaborative editor framework that can use React and Vue custom plug-ins. 一个富文本实时协同编辑器框架,可以使用React和Vue自定义插件。
Stars: ✭ 542 (+121.22%)
Mutual labels:  text-editor, rich-text-editor, wysiwyg-editor
Wysiwyg.js
wysiwyg contenteditable editor (minified+compression: 6kb)
Stars: ✭ 520 (+112.24%)
Mutual labels:  text-editor, rich-text-editor, wysiwyg-editor
typester
✒️ A WYSIWYG that gives you predictable and clean HTML
Stars: ✭ 29 (-88.16%)
Mutual labels:  text-editor, rich-text-editor, wysiwyg-editor
Mui Rte
Material-UI Rich Text Editor and Viewer
Stars: ✭ 233 (-4.9%)
Mutual labels:  text-editor, rich-text-editor, draft-js
Dante2
A complete rewrite of dante editor in draft-js
Stars: ✭ 890 (+263.27%)
Mutual labels:  draft-js, wysiwyg-editor
React Lz Editor
A multilingual react rich-text editor component includes media support such as texts, images, videos, audios, links etc. Development based on Draft-Js and Ant-design, good support html, markdown, draft-raw mode. 一款基于 draft-Js 和 ant-design 实现的 react 富文本编辑器组件,支持文本、图片、视频、音频、链接等元素插入,同时支持HTML、markdown、draft Raw格式。
Stars: ✭ 894 (+264.9%)
Mutual labels:  text-editor, draft-js
Jodit
Jodit - Best WYSIWYG Editor for You
Stars: ✭ 947 (+286.53%)
Mutual labels:  rich-text-editor, wysiwyg-editor
Draft Extend
Build extensible Draft.js editors with configurable plugins and integrated serialization.
Stars: ✭ 109 (-55.51%)
Mutual labels:  rich-text-editor, draft-js
Proton
Purely native and extensible rich text editor for iOS and macOS Catalyst apps
Stars: ✭ 685 (+179.59%)
Mutual labels:  rich-text-editor, wysiwyg-editor
Suneditor
Pure javascript based WYSIWYG html editor, with no dependencies.
Stars: ✭ 557 (+127.35%)
Mutual labels:  rich-text-editor, wysiwyg-editor
Vue Froala Wysiwyg
Vue component for Froala WYSIWYG HTML Rich Text Editor.
Stars: ✭ 553 (+125.71%)
Mutual labels:  rich-text-editor, wysiwyg-editor
Canner Slate Editor
📝Rich Text / WYSIWYG Editor built for Modularity and Extensibility.
Stars: ✭ 1,071 (+337.14%)
Mutual labels:  rich-text-editor, wysiwyg-editor
Ng Quill
AngularJS Component for Quill rich text editor
Stars: ✭ 223 (-8.98%)
Mutual labels:  rich-text-editor, wysiwyg-editor
React Native Draftjs
A full fledged React Native Rich Text editor based on draft.js
Stars: ✭ 103 (-57.96%)
Mutual labels:  text-editor, rich-text-editor
Medium Draft
📝 A medium like Rich Text Editor built on draft-js with a focus on keyboard shortcuts.
Stars: ✭ 1,705 (+595.92%)
Mutual labels:  rich-text-editor, draft-js
React Tapable Editor
A pluginable, intuitive medium/notion like rich text editor(currently in wip)
Stars: ✭ 170 (-30.61%)
Mutual labels:  rich-text-editor, draft-js

react-text-selection-popover

A react component that lets you render a popover in relation to the current text selection.

NPM JavaScript Style Guide

Install

npm install --save react-text-selection-popover

Usage

import css from '@emotion/css'

<Popover
  render={
    ({ clientRect, isCollapsed, textContent }) => {
      if (clientRect == null || isCollapsed) return null

      // I'm using emotion for this example but you can use anything really
      const style = css`
        position: absolute;
        left: ${clientRect.left + clientRect.width / 2}px;
        top: ${clientRect.top - 40}px;
        margin-left: -75px;
        width: 150px;
        background: blue;
        font-size: 0.7em;
        pointer-events: none;
        text-align: center;
        color: white;
        border-radius: 3px;
      `

      return <div className={style}>
        Selecting {(textContent || '').length} characters
      </div>
    }
  }
/>

Props

name type description
render ({ clientRect, isCollapsed, textContent }) => {} required Render prop for rendering your popover, see above for usage
mount HTMLElement Dom Element that Popover will be rendered into (This component uses React Portals. Defaults to document.body
target HTMLElement Dom Element which the popover is constrained to

Shoutouts

This was originally written during some freelance work for Spectrum. Shoutout to their awesomeness for letting me do all my work for them in the open!

Work with me?

I build editors for companies, or help their teams do so. Hit me up on my website to get in touch about a project.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].