Skip to content

按钮状态样式

可以像 CSS 一样为元素增加 hoverpressfocusselecteddisabled 交互状态样式,深入了解 交互状态插件

按钮交互效果

ts
import { Leafer, Rect } from 'leafer-ui'
import '@leafer-in/state'

const leafer = new Leafer({ view: window })

const rect = new Rect({
    width: 100,
    height: 100,
    fill: 'rgba(50,205,121, 0.7)',
    cornerRadius: 30,
    hoverStyle: { fill: 'rgba(50,205,121, 0.8)' },
    pressStyle: { fill: 'rgba(50,205,121, 1)' },
    cursor: 'pointer'
})

leafer.add(rect)

Released under the MIT License.