prateekbh / preact-material-components

preact wrapper for "Material Components for the web"
https://material.preactjs.com
MIT License
554 stars 81 forks source link

Incorrect docs for IconButton #1162

Open andria-dev opened 5 years ago

andria-dev commented 5 years ago

The docs for <IconButton> are clearly not the correct docs, they show an example for <IconToggle>:

import {h, Component} from 'preact';
import IconToggle from 'preact-material-components/IconToggle';
import 'preact-material-components/IconToggle/style.css';

export default class IconTogglePage extends Component {
  render(){
    const toggleOnIcon = {
      content: "favorite",
      label: "Remove From Favorites"
    };
    const toggleOffIcon = {
      content: "favorite_border",
      label: "Add to Favorites"
    };
    return (
      <div>
        <IconButton>
          <IconButton.Icon on>favorite</IconButton.Icon>
          <IconButton.Icon>favorite_border</IconButton.Icon>
        </IconButton>
      </div>
    );
  }
}

This section should be renamed "IconToggle" and there should be a separate section for "IconButton".

cromefire commented 5 years ago

Yes the docs are not totally up to date, they were forked from icon toggle, so there may be elements that are not renamed yet.