Socket
Socket
Sign inDemoInstall

react-slite

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-slite

> `SL`ack `I`nspired `T`ext `E`diting


Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

react-slite

SLack Inspired Text Editing

This react component aims to provide a slack like rich text editing experience powered by lexical library. This project is currently in alpha stage and used internally for Remindoro extension.

NOTE: Starting v0.2.0, react-slite is powered by lexical. Right now, it is just a thin wrapper around vanilla lexical functionality. As lexical becomes more stable and moves towards v1.x, this library will become more feature complete. Till then, apis are subject to change.

Usage

import Slite, { Toolbar, Editor, SliteProps, ThemeClassList, SLITE_EDITOR_CONTAINER_CLASS } from '../index'

function SliteWrapper({ initialValue, onChange, readOnly }: SliteProps) {
  return (
    <Slite
      initialValue={`your initial markdown string`}
      onChange={(currentMarkdown) => {}}
      readOnly={false}
    >
      {/* decide if and how you want to display the toolbar */}
      {!readOnly && <Toolbar />}
      {/* editor text area */}
      <Editor readOnly={readOnly} />
    </Slite>
  )
}

// ThemeClassList has all the classes used within the rich text editor
// SLITE_EDITOR_CONTAINER_CLASS exports the container class name, which is `slite-container`
// With this info, theming can be done via classes

For more examples, please run pnpm run storybook in the repo.

FAQs

Package last updated on 09 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc