basic.mdx 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. ---
  2. title: Basic Example
  3. ---
  4. import * as styles from './basic.module.scss'
  5. <div className={styles.container}>
  6. <div
  7. id="toolbar-container"
  8. style={{
  9. borderTop: '1px solid #ccc',
  10. borderLeft: '1px solid #ccc',
  11. borderRight: '1px solid #ccc',
  12. padding: 10,
  13. }}
  14. >
  15. <select className="ql-font" title="Font" defaultValue="sans-serif">
  16. <option value="sans-serif">Sans Serif</option>
  17. <option value="serif">Serif</option>
  18. <option value="monospace">Monospace</option>
  19. </select>
  20. <select className="ql-size" title="Size" defaultValue="normal">
  21. <option value="small">Small</option>
  22. <option value="normal">Normal</option>
  23. <option value="large">Large</option>
  24. <option value="huge">Huge</option>
  25. </select>
  26. <select className="ql-color" title="Text Color" defaultValue="black">
  27. <option value="white">White</option>
  28. <option value="black">Black</option>
  29. <option value="red">Red</option>
  30. <option value="orange">Orange</option>
  31. <option value="yellow">Yellow</option>
  32. <option value="green">Green</option>
  33. <option value="blue">Blue</option>
  34. <option value="purple">Purple</option>
  35. </select>
  36. <select className="ql-background" title="Background Color" defaultValue="white">
  37. <option value="white">White</option>
  38. <option value="black">Black</option>
  39. <option value="red">Red</option>
  40. <option value="orange">Orange</option>
  41. <option value="yellow">Yellow</option>
  42. <option value="green">Green</option>
  43. <option value="blue">Blue</option>
  44. <option value="purple">Purple</option>
  45. </select>
  46. <select className="ql-align" title="Text Alignment" defaultValue="left">
  47. <option value="left">Left</option>
  48. <option value="center">Center</option>
  49. <option value="right">Right</option>
  50. <option value="justify">Justify</option>
  51. </select>
  52. <button className="ql-bold" title="Bold">Bold</button>
  53. <button className="ql-italic" title="Italic">Italic</button>
  54. <button className="ql-underline" title="Underline">Under</button>
  55. <button className="ql-strike" title="Strikethrough">Strike</button>
  56. <button className="ql-link" title="Link">Link</button>
  57. <button className="ql-image" title="Image">Image</button>
  58. <button className="ql-list" title="Bullet" value="bullet">Bullet</button>
  59. <button className="ql-list" title="List" value="ordered">List</button>
  60. </div>
  61. <Editor
  62. style={{
  63. border: '1px solid #ccc',
  64. height: 250,
  65. }}
  66. config={{
  67. debug: 'info',
  68. modules: {
  69. toolbar: '#toolbar-container',
  70. },
  71. }}
  72. />
  73. </div>