menu
Dark Mode
backgroundLayer 1
preact-material-components
Components and their props
  • Typography
    • headline6 true/false
      Adds `headline6` typography style.
    • headline5 true/false
      Adds `headline5` typography style.
    • headline4 true/false
      Adds `headline4` typography style.
    • headline3 true/false
      Adds `headline3` typography style.
    • headline2 true/false
      Adds `headline2` typography style.
    • headline1 true/false
      Adds `headline1` typography style.
    • subtitle2 true/false
      Adds `subtitle2` typography style.
    • subtitle1 true/false
      Adds `subtitle1` typography style.
    • body2 true/false
      Adds `body2` typography style.
    • body1 true/false
      Adds `body1` typography style.
    • button true/false
      Adds `button` typography style.
    • caption true/false
      Adds `caption` typography style.
    • overline true/false
      Adds `overline` typography style.
Sample code
import {h, Component} from 'preact';
import Typography from 'preact-material-components/Typography';
import 'preact-material-components/Typography/style.css';

export default class FabPage extends Component {
  render(){
    return (
      <div>
        <div><Typography headline6>Headline6</Typography></div>
        <div><Typography headline5>Headline5</Typography></div>
        <div><Typography headline4>Headline4</Typography></div>
        <div><Typography headline3>Headline3</Typography></div>
        <div><Typography headline2>Headline2</Typography></div>
        <div><Typography headline1>Headline1</Typography></div>
        <div><Typography body1>Body1</Typography></div>
        <div><Typography body2>Body2</Typography></div>
      </div>
    );
  }
}
Original documentation
This component encapsulates mdc-typography, you can refer to its documentation here.
Demo
Headline 1
<Typography headline1>Headline 1</Typography>
Headline 2
<Typography headline2>Headline 2</Typography>
Headline 3
<Typography headline3>Headline 3</Typography>
Headline 4
<Typography headline4>Headline 4</Typography>
Headline 5
<Typography headline5>Headline 5</Typography>
Headline 6
<Typography headline6>Headline 6</Typography>