Installation
Run this command:
npm i react-99
If you're using Reason, then add it to your bs-dependencies
in your bsconfig.json
file:
"bs-dependencies": [
"react-99"
]
Example code
Choose your language:
Tired of modern styling code? Miss setting font size with <FONT>
? How about ye olde <BLINK>
tag?
open React99;
module SuperCoolHeader = {
[@react.component]
let make = () =>
<CENTER>
<BLINK>
<FONT color="red" size="7">
{React.string("Get up and slam!")}
</FONT>
</BLINK>
</CENTER>;
};
import {BLINK, CENTER, FONT} from "react-99";
const SuperCoolHeader = () =>
<CENTER>
<BLINK>
<FONT color="red" size="7">
Get up and slam!
</FONT>
</BLINK>
</CENTER>;
<BASEFONT>
can be used to set the default font size inherited by children <FONT>
tags.
open React99;
module MindBlowingEffect = {
[@react.component]
let make = () =>
<BASEFONT color="aqua" size=5 face="comic sans ms">
<CENTER>
<marquee>
{React.string("And welcome to the ")}
<FONT size="+1"> {React.string("Jam.")} </FONT>
</marquee>
</CENTER>
</BASEFONT>;
};
import {CENTER, BASEFONT, FONT} from "react-99";
const MindBlowingEffect = () =>
<BASEFONT color="aqua" size={5} face="comic sans ms">
<CENTER>
<marquee>
And welcome to the <FONT size="+1">Jam.</FONT>
</marquee>
</CENTER>
</BASEFONT>;
API reference
<CENTER>
Centers the text of its children.
<BLINK>
Gives the text a "blink" effect.
<BASEFONT>
Sets the default font for its children. The size
prop can be an integer from 1 to 7.
Prop | Type |
---|---|
children | reactElement |
color | option(string) |
face | option(string) |
size | option(int) |
<FONT>
Sets the font for its children. The size
prop is a string of an integer. It can begin with a "+" or a "-" to add or subtract the number from the BASEFONT
defaults.
Prop | Type |
---|---|
children | reactElement |
color | option(string) |
face | option(string) |
size | option(string) |
Notes
React '99 is made with ReasonReact, but it's probably usable by regular ReactJS too. It requires the bs-platform
and reason-react
modules, which it lists as peer dependencies. You'll need to install those to use it.
I don't test JavaScript, so use at your own risk.
The default font size is 3, which is equivilant to 16px.