mdbutton

package
v0.0.0-...-aecb3d9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2018 License: MIT Imports: 2 Imported by: 2

README

md-button element

Implementation of the material design button

usage

The material design button has the following properties:

  • Raised bool
  • Disabled bool
  • Hidden bool
  • Elevation int

example

import (
	"github.com/microo8/golymer"
	_ "github.com/microo8/golymer/elements/md-button"
)

var template := golymer.NewTemplate(`
<style>
	--primary-color: #3F51B5;
</style>

<md-button elevation="2" on-click="ButtonClicked">click me!</md-button>
`)

type MyElem struct {
	golymer.Element
}

func newMyElem() *MyElem {
	e := new(MyElem)
	e.SetTemplate(template)
	return e
}

func (e *MyElem) ButtonClicked(event *golymer.Event) {
	print("Button Clicked!")
}

func init() {
	err := golymer.Define(newMyElem)
	if err != nil {
		panic(err)
	}
}

md-button

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MdButton

type MdButton struct {
	golymer.Element
	Raised    bool
	Disabled  bool
	Hidden    bool
	Elevation int
}

MdButton implementation of material design button

func NewMdButton

func NewMdButton() *MdButton

NewMdButton creates new MDButton

func (*MdButton) ConnectedCallback

func (b *MdButton) ConnectedCallback()

ConnectedCallback adds click listener for the ripple effect

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL