1.2.0 • Published 3 years ago

react-eulexia v1.2.0

Weekly downloads
47
License
MIT
Repository
github
Last release
3 years ago

react-eulexia

JavaScript Style Guide License: MIT CircleCI codecov

Components library to allow UI customizations, giving the person the possibility to adjust the website according to their visual needs. The final goal is to provide accessibility, turning websites more inclusive for people with reading difficulties, such as dyslexia.

Demo

Edit react-eulexia

Or, check this example and it's source code!

Install

yarn add react-eulexia

or

npm install react-eulexia

Usage

import React from 'react'
import {
  EulexiaFab,
  ColorChangeAction,
  FontFamilyAction,
  FontSizeAction,
  RulerAction,
  TextToSpeechAction
} from 'react-eulexia'

function App () {
  return (
    <div>
      {/* Other page elements */}
      <EulexiaFab>
        <FontSizeAction />
        <FontFamilyAction />
        <ColorChangeAction />
        <RulerAction />
        <TextToSpeechAction />
      </EulexiaFab>
    </div>
  )
}

export default App

Features

Gives the user the possibility to:

  • Change the page's text and background color
  • Change the page's font family
  • Change the page's font size
  • Display a reading ruler
  • Use text-to-speech to read the selected text

Components

The main component is called EulexiaFab. Inside it, we can pass some Action buttons, which can be used independently from each other, and each provide some unique features.

The configurations made by the user that is visting the website are stored on the localStorage, so that the setup can be kept through the pages the user visits within the website.

EulexiaFab

The main component. It is basically a wrapper of the Fab provided by react-tiny-fab, with some default configurations.

PropTypeDefaultDescription
idstring'eulexiaFab'The id for the component.
backgroundColorstring'#A7C5E6'The Floating Action Button background color.
styleobject{ left: 20, bottom: 20 }The position the Fab is displayed on the screen.
eventstring'hover'The way the EulexiaFab displays the other Action buttons. It defaults to 'hover', but can also be 'click'
iconany<ConfigIcon />The icon to be displayed on the Floating Action Button. Defaults to <ConfigIcon />, a customized icon that displays a 'settings' icon from the Remix Icon set.
childrennodeThe children for this component should be the other components from this library. You can use the ones you want, no need to use all of them.

ColorChangeAction

This component lets the user modify the texts, links and background colors of the page. The color picker component is provided by react-colorful.

PropTypeDefaultDescription
backgroundColorOptionsarray['#F8F5F4', '#EBE3E1', '#F5F5DC', '#030303']The background color options.
backgroundLabelstring'Background'The label for the change background color feature.
iconany<ColorChangeIcon />The icon to be displayed on the Floating Action Button. Defaults to <ColorChangeIcon />, a customized icon that displays a paint-brush icon from the Remix Icon set.
paletteColorstring'#C1C1CC'The palette color. Palette is a div that wraps the color options displayed.
linkColorOptionsarray['#030303', '#191970', '#00008B', '#40E0D0']The link color options.
linkLabelstring'Text'The label for the change link color feature.
linkTagsarray['a']The tags that should be considered links, and will have the color change applied.
textColorOptionsarray['#030303', '#191970', '#00008B', '#40E0D0']The text color options.
textLabelstring'Text'The label for the change text color feature.
textTagsarray['h1', 'h2', 'h3', 'h4', 'h5', 'h6', '.h1', '.h2', '.h3', '.h4', '.h5', '.h6', 'p', 'li', 'span']The tags that should be considered texts, and will have the color change applied.
tooltipBackgroundColorstring'#FFFFFF'The background color for the tooltip.
tooltipTextColorstring'#000000'The text color for the tooltip.
tooltipTitlestring'Change color'The title displayed for the color change tooltip.

FontFamilyAction

This component lets the user modify the font family of the words on the page. The fonts are collected from Google Fonts. Today, the four fonts available on react-eulexia are 'Courier', 'Open Sans', 'Roboto' and 'Roboto Mono', all of them are either sans serif or monospaced, which are recommended for people with dyslexia.

PropTypeDefaultDescription
dropdownPlaceholderstring'Font family...'The font family dropdown placeholder.
iconany<FontFamilyIcon />The icon to be displayed on the Floating Action Button. Defaults to <FontFamilyIcon />, a customized icon that displays a text icon from the Remix Icon set.
textTagsarray['h1', 'h2', 'h3', 'h4', 'h5', 'h6', '.h1', '.h2', '.h3', '.h4', '.h5', '.h6', 'p', 'li', 'span']The tags that should be considered texts, and will have the font family change applied.
tooltipBackgroundColorstring'#FFFFFF'The background color for the tooltip.
tooltipTextColorstring'#000000'The text color for the tooltip.
tooltipTitlestring'Font family'The title displayed for the font family tooltip.

FontSizeAction

This component lets the user modify the font size of the words on the page. The words are separated into two categories, Headers and Texts, each has a different slider to set the value.

PropTypeDefaultDescription
headerLabelstring'Headers'The label for the change headers font size feature.
headerTagsarray['h1', 'h2', 'h3', 'h4', 'h5', 'h6', '.h1', '.h2', '.h3', '.h4', '.h5', '.h6']The tags that should be considered headers, and will have the font size change applied, as headers.
iconany<FontSizeIcon />The icon to be displayed on the Floating Action Button. Defaults to <FontSizeIcon />, a customized icon that displays a font-size icon from the Remix Icon set.
textLabelstring'Texts'The label for the change texts font size feature.
textTagsarray['p', 'li', 'span']The tags that should be considered texts, and will have the font size change applied, as texts.
tooltipBackgroundColorstring'#FFFFFF'The background color for the tooltip.
tooltipTextColorstring'#000000'The text color for the tooltip.
tooltipTitlestring'Font size'The title displayed for the font size change tooltip.

RulerAction

This component lets the user display a reading ruler on the page, a useful tool for people with dyslexia. The ruler size can be modified through a slider, and there is also an inverted mode that can be activated.

PropTypeDefaultDescription
iconany<RulerIcon />The icon to be displayed on the Floating Action Button. Defaults to <RulerIcon />, a customized icon that displays a ruler icon from the Remix Icon set.
invertedModeLabelstring'Inverted mode'The label for the inverted mode feature.
sizeLabelstring'Size'The label for the ruler size modifier slider.
tooltipBackgroundColorstring'#FFFFFF'The background color for the tooltip.
tooltipTextColorstring'#000000'The text color for the tooltip.
tooltipTitlestring'Reading ruler'The title displayed for the reading ruler tooltip.

TextToSpeechAction

This component lets the user use the text-to-speech feature to read a selected text. The Speech Synthesis API is used through react-speech-kit, so not all browsers are supported. If browser is not supported, a 'Browser not supported' label will be shown.

PropTypeDefaultDescription
forceHtmlLangbooleanfalseIf set to true, considers the value passed on htmlLang as the language. If false, the language considered will be caught from the lang attribute on the document.documentElement; if no lang value is found there, it will look for the lang value on the document.head; if no value is found there too, it will get the value from the htmlLang prop.
htmlLangstring'en-us'The htmlLang value. It's use varies according to the value of the forceHtmlLang prop.
iconany<TextToSpeechIcon />The icon to be displayed on the Floating Action Button. Defaults to <TextToSpeechIcon />, a customized icon that displays a volume icon from the Remix Icon set.
readSelectedLabelstring'Read selected'The label for the read selected feature.
tooltipBackgroundColorstring'#FFFFFF'The background color for the tooltip.
tooltipTextColorstring'#000000'The text color for the tooltip.
tooltipTitlestring'Text to speech'The title displayed for the text-to-speech tooltip.
unsupportedBrowserLabelstring'Browser not supported'The label displayed is case the browser is not supported.

Dependencies

This components on this library depends on some other great libraries. They are the following:

License

Licensed under MIT.

1.2.0

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.1.0

3 years ago

0.2.0

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago

0.0.0

3 years ago