Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Draftjs styling in React

Tags:

I want to use draft.js in my project. It has its own css which I also need to import. In the documentation it is said:

This CSS should be included when rendering the editor, as these styles set defaults for text alignment, spacing, and other important features.

  1. How do I include the Draft.css while rendering the component? Do I include it in my main index.html?
  2. Also how to give an id to the editor so that I can style it (eg. border, padding, min-height, etc)
like image 899
Robin Avatar asked Jul 10 '16 07:07

Robin


People also ask

What is Draftjs?

Draft. js is a framework for building rich text editors in React, powered by an immutable model and abstracting over cross-browser differences.


1 Answers

Depending on your setup, you should be able to include or import the Draft.css in the index.js file.

...
import 'draft-js/dist/Draft.css';
...
like image 154
Sergey Avatar answered Oct 13 '22 01:10

Sergey