0.10.0 • Published 6 years ago

@smollweide/material-ui-speed-dial v0.10.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

material-ui-speed-dial Build Status

Components, that implements material design speed dial for material-ui v1

demo

Installation

For the installation of Material-UI please have look in the Material-UI Documentation

Material-UI speed dial is available as an npm package.

npm install @smollweide/material-ui-speed-dial

Usage

import React from 'react';
import { withStyles } from 'material-ui/styles';
import Button from 'material-ui/Button';
import Avatar from 'material-ui/Avatar';

import AddIcon from 'material-ui-icons/Add';
import EditIcon from 'material-ui-icons/Edit';

import SpeedDial, { SpeedDialItem, SpeedDialLabel, SpeedDialBackdrop } from '@smollweide/material-ui-speed-dial';
import presetFixedBottomRight from '@smollweide/material-ui-speed-dial/dist/presets/presetFixedBottomRight';

const MyMaterialUiSpeedDial = ({ classes }) => {
  return (
    <SpeedDial
      preset={classes}
      renderButton={(props, propsIcon) => (
        <Button {...props} variant="fab" color="primary" aria-label="add">
          <AddIcon {...propsIcon} />
        </Button>
      )}
      renderOpenedButton={(props, propsIcon) => (
        <Button {...props} variant="fab" color="secondary" aria-label="edit">
          <EditIcon {...propsIcon} />
        </Button>
      )}
      renderList={props => <ul {...props} />}
      renderBackdrop={(props) => <SpeedDialBackdrop {...props} />}
    >
      {props => [
        <SpeedDialItem
          {...props}
          key="c"
          renderAvatar={propsAvatar => (
            <Avatar {...propsAvatar} alt="Eric Hoffman" src="http://lorempixel.com/80/80/people/3" />
          )}
        >
          {propsLabel => <SpeedDialLabel {...propsLabel} text="Eric Hoffman" />}
        </SpeedDialItem>,
        <SpeedDialItem
          {...props}
          key="b"
          renderAvatar={propsAvatar => (
            <Avatar {...propsAvatar} alt="Grace Ng" src="http://lorempixel.com/80/80/people/9" />
          )}
        >
          {propsLabel => <SpeedDialLabel {...propsLabel} text="Grace Ng" />}
        </SpeedDialItem>,
        <SpeedDialItem {...{ ...props, className: `${props.className} ${classes.firstItem}` }} key="a">
          {propsLabel => <SpeedDialLabel {...propsLabel} text="Edit" />}
        </SpeedDialItem>,
      ]}
    </SpeedDial>
  );
};
MyMaterialUiSpeedDial.displayName = 'MyMaterialUiSpeedDial';

export default withStyles(presetFixedBottomRight)(MyMaterialUiSpeedDial);

Examples

API

Components

Utils

Flow

Import the flow lib from node_modules

[libs]
./node_modules/@smollweide/material-ui-speed-dial/material-ui-speed-dial.js.flow

Related

Contributing

See CONTRIBUTING.md for more information.

Shields

coverage status npm downloads MIT License Codestyle strictly typed with flow Commitizen friendly styled with prettier semantic-release

0.10.0

6 years ago

0.9.0

6 years ago

0.8.0

6 years ago

0.7.0

6 years ago

0.6.0

6 years ago

0.5.0

6 years ago

0.4.0

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago