Skip to content

Instantly share code, notes, and snippets.

@rrharvey
Created May 24, 2017 13:24
Show Gist options
  • Select an option

  • Save rrharvey/cc62037df56e635cba6a62bea48d7500 to your computer and use it in GitHub Desktop.

Select an option

Save rrharvey/cc62037df56e635cba6a62bea48d7500 to your computer and use it in GitHub Desktop.

Revisions

  1. rrharvey created this gist May 24, 2017.
    35 changes: 35 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    import * as React from 'react';
    import * as classNames from 'classnames';

    interface DropdownProps {
    text: string;
    rightAlign?: boolean;
    }

    class Dropdown extends React.Component<DropdownProps, null> {
    constructor() {
    super();
    }

    render() {
    const { text, rightAlign } = this.props;
    return (
    <div className="dropdown">
    <button type="button"
    className="btn btn-default dropdown-toggle"
    >
    {text} <span className="caret" />
    </button>
    <ul className={classNames('dropdown-menu', { 'dropdown-menu-right': rightAlign })}>
    <li><a href="#">Action</a></li>
    <li><a href="#">Another action</a></li>
    <li><a href="#">Something else here</a></li>
    <li role="separator" className="divider" />
    <li><a href="#">Separated link</a></li>
    </ul>
    </div>
    );
    }
    }

    export default Dropdown;