JSPM

react-basesupsub

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q27451F
  • License MIT

react-basesupsub React component

Package Exports

  • react-basesupsub

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-basesupsub) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-basesupsub

Travis Coveralls Commitizen friendly npm package npm downloads License

Simple component to render an element composed by baseline, superscript and subscript.

Usage

<BaseSupSub base="mybase" sup="mysuperscript" sub="mysubscript" />

<BaseSupSub base={10} sup={2} sub="something" />

<BaseSupSub
  base={10}
  sup={2}
  sub="something"
  className="myclass1 myclass2"
/>

<BaseSupSub
  base={10}
  sup={2}
  sub="something"
  style={{ color: 'red', fontSize: '30px' }}
/>

<BaseSupSub
  base={10}
  sup={2}
  sub="something"
  style={{ color: 'red', fontSize: '30px', display: 'block' }}
/>

Notes

  • The component has a default display mode of inline-block. This default is established using CSS Modules, to allow you overwrite it with two methods:

    • Applying your own class to the component, that sets another display mode:

      <BaseSup className="yourclass" ......... />
    • Setting inline styles:

      <BaseSup style={{ display: 'block' }} ......... />
  • If you don't establish a base value, the component will render null.

  • If you set only a base value, the component will render a simple div with all the props.