导入

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'填充样式:solid、soft、outline 或 ghost。
tone输入'accent' | 'neutral' | 'danger''accent'配色:accent、neutral 或 danger。
size输入'sm' | 'md' | 'lg''md'高度、内边距和字号:sm、md 或 lg。
disabled输入booleanfalse禁用按钮。用于链接时会设置 aria-disabled,并阻止链接被激活。
motion输入NuiMotion运动时使用的弹簧:snappy、bouncy、jelly、elastic、lazy、mechanical 或 none。
spring输入NuiSpring任意弹簧,以 { stiffness, damping, mass } 的形式指定,在运行时编译为 CSS。它会覆盖 motion。
press输入NuiPress按住时的效果:sink、squish、pop、wobble、rubber、tilt 或 none。
corners输入NuiCorners边角的形状:round、squircle、bevel、scoop、notch 或 square。
radius输入NuiRadius边角的大小:none、small、medium、large 或 full。
density输入NuiDensity占用的空间:compact、regular 或 roomy。

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