Button
Basic types
Plain, text and shapes
Disabled and loading
Loading disables the native button, shows a spinning SVG and hides the normal icon without requiring Element UI fonts. Disabled/loading buttons do not emit click.
Sizes
The default remains mini (12px font, 7px × 12px padding), not Element Plus's default. medium uses 14px and 10px × 12px; small uses 12px and 9px × 12px.
Interaction, icons and native forms
icon accepts legacy class strings or Vue icon components. Common legacy names (el-icon-search/edit/check/message/star-off/delete/plus/close/download/upload) map to built-in SVGs. Other strings remain CSS classes; consumers supply their fonts/styles, just as before. Element Plus does not include the Element UI icon font: replace unmapped names with a component, such as :icon="Search" imported from @element-plus/icons-vue. Give icon-only buttons an aria-label.
Global configuration
NfConfigProvider accepts all button props through nf-button. Explicit button values (including false) win; nested providers inherit per property and update reactively. The fallback size remains mini. This configuration is separate from Element Plus's top-level size / button.
<NfConfigProvider :nf-button="{ size: 'medium', type: 'primary', loading: true }">
<NfButton>Inherited</NfButton>
<NfButton size="small" :loading="false">Local override</NfButton>
</NfConfigProvider>See the interactive provider example.
On-demand installation
import NfButton from '@94ai-plus/nf-button'
import '@94ai-plus/nf-theme-chalk/nf-button.css'
app.use(NfButton)For OEM use @94ai-plus/nf-theme-oem/nf-button.css. Installing CommonUI already registers NfButton. Named imports and CommonUIResolver() are supported. The component's standalone CSS entry is @94ai-plus/nf-button/style.css.
Props
| Prop | Description | Type / values | Default |
|---|---|---|---|
| type | Semantic type | primary / success / info / warning / danger / text | — |
| size | Legacy size | mini / small / medium | mini |
| icon | Icon class or Vue component | string / Component | — |
| plain | Plain button | boolean | false |
| text | Text button; also enabled by type="text" | boolean | false |
| round | Rounded corners | boolean | false |
| circle | Circular button | boolean | false |
| loading | Show loading and block clicks | boolean | false |
| disabled | Disable button | boolean | false |
| autofocus | Native autofocus | boolean | false |
| native-type | Native form behavior | button / submit / reset | button |
Undeclared attributes such as id, class, style, name, value, aria-* and data-* fall through to the native button. Vue 3 listener fallthrough replaces Vue 2 .native. Keyboard :focus-visible styles do not change mouse states.
Events and slots
| Name | Contract |
|---|---|
| click | (event: MouseEvent) => void, preserving the native event |
| default | Button content; no content span is generated when absent |
