0.1.32 • Published 5 months ago

react-font-editor v0.1.32

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

React Font Editor

The component is a tool that provides an information box with text formatting options for React applications.

Installation

To use the FontEditor, you can install it via npm:

npm install react-font-editor

Usage

Import the FontEditor component in your code:

import React from 'react';
import FontEditor from 'react-font-editor';

const App = () => {
  return (
    <div>
      <h1>Example Usage of FontEditor</h1>
      <FontEditor
        label="FontEditor Text"
        withColor={true}
        withDecoration={true}
        withSize={true}
        fireEvent="click"
        defaultValue={{
          fontFamily: 'Arial, sans-serif',
          fontSize: 14,
          color: '#000000',
          textDecoration: 'none',
        }}
        onStyleChanged={(value) => console.log('Style changed:', value)}
        sizes={{
          Small: 12,
          Medium: 16,
          Large: 20,
        }}
        fonts={{
          Arial: 'Arial, sans-serif',
          'Times New Roman': 'Times New Roman, serif',
          Verdana: 'Verdana, sans-serif',
          'Courier New': 'Courier New, monospace',
        }}
      />
    </div>
  );
};

export default App;

Props

The FontEditor component has various configurable props to customize the behavior and style of the FontEditor. Some of the main props include:

  • label: Text to be displayed in the FontEditor.
  • withColor: Enables color selection option for text.
  • withDecoration: Enables text formatting option (bold, italic, underline).
  • withSize: Enables font size selection option.
  • fireEvent: Defines the FontEditor activation event (click or hover).
  • defaultValue: Initial styles for the content.
  • onStyleChanged: Callback function to capture style changes. Refer to the documentation or component implementation to see all available props.

Contribution

Contributions are welcome! If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for more details.

0.1.32

5 months ago

0.1.31

6 months ago

0.1.30

6 months ago

0.1.29

6 months ago

0.1.28

6 months ago

0.1.27

6 months ago

0.1.25

6 months ago

0.1.24

6 months ago

0.1.23

6 months ago

0.1.22

6 months ago

0.1.21

6 months ago

0.1.20

6 months ago

0.1.19

6 months ago

0.1.18

6 months ago

0.1.17

6 months ago

0.1.12

6 months ago

0.1.11

6 months ago

0.1.8

6 months ago

0.1.7

6 months ago

0.1.6

6 months ago

0.1.5

6 months ago

0.1.4

6 months ago

0.1.3

6 months ago