导入

import-button.ts
import { NuiButton } from '@needless-ui/angular/button';

NuiButton

为原生的 <button><a> 应用按钮样式。

选择器
button[nuiButton], a[nuiButton]
导出为
nuiButton
NuiButton: 属性
名称类型默认值说明
variant输入'solid' | 'soft' | 'outline' | 'ghost''solid'填充样式:solidsoftoutlineghost
tone输入'accent' | 'neutral' | 'danger''accent'配色:accentneutraldanger
size输入'sm' | 'md' | 'lg''md'高度、内边距和字号:smmdlg
disabled输入booleanfalse禁用按钮。用于链接时会设置 aria-disabled,并阻止链接被激活。
motion输入NuiMotion运动时使用的弹簧:snappybouncyjellyelasticlazymechanicalnone
spring输入NuiSpring任意弹簧,以 { stiffness, damping, mass } 的形式指定,在运行时编译为 CSS。它会覆盖 motion
press输入NuiPress按住时的效果:sinksquishpopwobblerubbertiltnone
corners输入NuiCorners边角的形状:roundsquirclebevelscoopnotchsquare
radius输入NuiRadius边角的大小:nonesmallmediumlargefull
density输入NuiDensity占用的空间:compactregularroomy

用于自定义的输入属性如果未设置,会沿用最近的 data-nui-* 属性。详见自定义指南