导入
import { NuiButton } from '@needless-ui/angular/button';NuiButton
为原生的 <button> 或 <a> 应用按钮样式。
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
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输入 | boolean | false | 禁用按钮。用于链接时会设置 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-* 属性。详见自定义指南。