### Configure Buefy Plugin
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/configuration.md
Example of installing the Buefy plugin with custom global configuration options.
```javascript
import { createApp } from 'vue'
import Buefy from '@ntohq/buefy-next'
const app = createApp({})
app.use(Buefy, {
defaultIconPack: 'fas',
defaultToastPosition: 'is-bottom-right',
defaultDatepickerMobileNative: false,
defaultModalCanCancel: ['escape', 'x'],
defaultLocale: 'en-US',
customIconPacks: {
custom: {
sizes: { small: 'is-small', medium: 'is-medium' },
iconPrefix: 'icon-'
}
}
})
```
--------------------------------
### Install Buefy globally
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/plugin-and-programmatic-api.md
Installs all components and services at once with optional configuration.
```typescript
import { createApp } from 'vue'
import Buefy from '@ntohq/buefy-next'
import '@ntohq/buefy-next/dist/buefy.css'
const app = createApp({})
app.use(Buefy)
// or with configuration
app.use(Buefy, {
defaultToastPosition: 'is-bottom-right',
defaultDatepickerMobileNative: false
})
```
--------------------------------
### Implement BTabs with BTabItem
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/layout-components.md
A complete example showing how to structure tabs with labels, icons, and closable items using Vue 3 script setup.
```vue
```
--------------------------------
### Install individual components
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/OVERVIEW.md
Register specific components to reduce bundle size.
```javascript
import { createApp } from 'vue'
import { Field, Input, Button } from '@ntohq/buefy-next'
import '@ntohq/buefy-next/dist/buefy.css'
const app = createApp({})
app.use(Field)
app.use(Input)
app.use(Button)
```
--------------------------------
### Install Buefy-Next globally
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/OVERVIEW.md
Register the entire library with a Vue application instance.
```javascript
import { createApp } from 'vue'
import Buefy from '@ntohq/buefy-next'
import '@ntohq/buefy-next/dist/buefy.css'
const app = createApp({})
app.use(Buefy)
```
--------------------------------
### Install Developer Releases
Source: https://github.com/ntohq/buefy-next/blob/dev/README.md
Commands to install specific developer versions or the latest snapshot from the GitHub registry.
```bash
npm install buefy@npm:@ntohq/buefy-next@-
```
```bash
npm install buefy@npm:@ntohq/buefy-next@latest
```
--------------------------------
### BSnackbar Usage Example
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/modal-dialog-notice.md
Demonstrates opening a snackbar with an action callback.
```javascript
this.$buefy.snackbar.open({
message: 'Item deleted',
actionText: 'Undo',
type: 'is-info',
position: 'is-bottom-right',
onAction: () => {
console.log('Undoing...')
}
})
```
--------------------------------
### Implement BMenu Usage Example
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/layout-components.md
A complete example showing the structure of a menu with multiple lists and items using the Vue composition API.
```vue
```
--------------------------------
### Install and Initialize Buefy-next
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/README.md
Import the library and its CSS, then register the plugin with a Vue 3 application instance.
```typescript
import Buefy from '@ntohq/buefy-next'
import '@ntohq/buefy-next/dist/buefy.css'
const app = createApp({})
app.use(Buefy)
```
--------------------------------
### Install specific components
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/plugin-and-programmatic-api.md
Install only required components to reduce bundle size.
```typescript
import { createApp } from 'vue'
import { Button, Field, Input } from '@ntohq/buefy-next'
import '@ntohq/buefy-next/dist/buefy.css'
const app = createApp({})
app.use(Button)
app.use(Field)
app.use(Input)
```
--------------------------------
### Install Buefy-next via NPM
Source: https://github.com/ntohq/buefy-next/blob/dev/README.md
Use this command to install the Vue 3 compatible fork under the buefy alias.
```sh
npm install buefy@npm:@ntohq/buefy-next
```
--------------------------------
### Install Buefy-Next plugin
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/EXPORTS.md
The main entry point for installing the Buefy-Next plugin into a Vue application.
```typescript
export default Buefy = {
install(Vue: App, options?: BuefyConfigOptions): void
}
```
--------------------------------
### BSwitch Usage Example
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/advanced-form-inputs.md
Demonstrates basic, colored, and disabled switch configurations using v-model for state management.
```vue
Enable feature
Send notifications
Dark mode
Locked setting
```
--------------------------------
### BSidebar Usage Example
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/layout-components.md
Demonstrates using BSidebar with menu items and a toggle button.
```vue
```
--------------------------------
### Implement BNavbar in Vue
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/layout-components.md
A complete example showing the structure of a navigation bar using slots for brand, start, and end sections.
```vue
My App
Documentation
GitHub
Profile
Logout
```
--------------------------------
### Buefy.install
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/EXPORTS.md
Installs the Buefy plugin into a Vue application.
```APIDOC
## Buefy.install(Vue: App, options?: BuefyConfigOptions)
### Description
Installs the Buefy plugin into the specified Vue application instance with optional configuration.
### Parameters
- **Vue** (App) - Required - The Vue application instance.
- **options** (BuefyConfigOptions) - Optional - Configuration options for the plugin.
```
--------------------------------
### BNotification Usage Example
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/modal-dialog-notice.md
Demonstrates both declarative component usage and programmatic triggering.
```vue
This is an informational notification
```
--------------------------------
### Implement component usage patterns
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/EXPORTS.md
Common patterns for importing and installing components or the main plugin.
```typescript
// Pattern 1: Import and install
import Button from '@ntohq/buefy-next'
app.use(Button)
// Pattern 2: Direct component import
import { BButton } from '@ntohq/buefy-next'
// Pattern 3: Main plugin
import Buefy from '@ntohq/buefy-next'
app.use(Buefy)
```
--------------------------------
### BButton Usage Examples
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/button-icon-image.md
Demonstrates various button configurations including icons, loading states, full-width styling, and custom tags.
```vue
Click meAdd Item
```
--------------------------------
### BImage Usage Examples
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/button-icon-image.md
Demonstrates various configurations including aspect ratios, lazy loading, responsive behavior, WebP fallbacks, and custom srcset formatting.
```vue
```
--------------------------------
### BInput Usage Examples
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/form-controls.md
Demonstrates various configurations including basic inputs, email/password types, icons, character counters, read-only states, and custom slots.
```vue
$.00
```
--------------------------------
### BIcon Usage Examples
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/button-icon-image.md
Demonstrates various ways to implement icons, including different packs, sizes, custom classes, and integration within a button.
```vue
```
--------------------------------
### Initialize with type-safe configuration
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/configuration.md
Apply configuration during application setup using the BuefyConfigOptions type for type safety.
```typescript
import type { BuefyConfigOptions } from '@ntohq/buefy-next'
const config: BuefyConfigOptions = {
defaultToastDuration: 5000,
defaultToastPosition: 'is-bottom'
}
app.use(Buefy, config)
```
--------------------------------
### Implement BDatepicker Usage Examples
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/date-time-color.md
Demonstrates various BDatepicker configurations including single date, range selection, multiple date selection, and inline display.
```vue
```
--------------------------------
### BColorpicker Usage Example
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/date-time-color.md
Demonstrates various configurations including inline pickers, input-based pickers, and different representation styles.
```vue
```
--------------------------------
### BTaginput Usage Examples
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/advanced-form-inputs.md
Demonstrates various configurations including basic tags, autocomplete suggestions, tag limits with counters, and custom tag formatting.
```vue
```
--------------------------------
### BAutocomplete Usage Examples
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/advanced-form-inputs.md
Demonstrates basic usage, custom formatting with grouping, and asynchronous data fetching with custom slot rendering.
```vue
```
--------------------------------
### BModal Usage Example
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/modal-dialog-notice.md
Demonstrates using BModal with v-model and as a structured modal card.
```vue
This is the modal content
Cancel
Submit
```
--------------------------------
### BClockpicker Usage Example
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/date-time-color.md
Implementation of a clock picker component with auto-switch enabled.
```vue
```
--------------------------------
### Implement BRate Usage Examples
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/advanced-form-inputs.md
Demonstrates standard star rating implementation and custom text feedback using the BRate component.
```vue
```
--------------------------------
### BSelect Usage Examples
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/form-controls.md
Demonstrates basic selection, multiple selection, and data-bound options using the BSelect component.
```vue
```
--------------------------------
### BCheckbox Usage Example
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/form-controls.md
Demonstrates single checkbox, checkbox group, and indeterminate state implementation.
```vue
I agree to terms
Item 1
Item 2
Select all (partial)
```
--------------------------------
### Install Buefy as a Plugin
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/INDEX.md
Registers the entire Buefy library with the Vue application instance using the provided configuration.
```typescript
import Buefy from '@ntohq/buefy-next'
app.use(Buefy, config)
```
--------------------------------
### BUpload Usage Example
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/advanced-form-inputs.md
Demonstrates basic file upload with drag-and-drop and multiple file selection using BUpload, BField, and BIcon components.
```vue
Drop images here or click to upload
Click to upload files
```
--------------------------------
### BTimepicker Usage Examples
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/date-time-color.md
Demonstrates standard timepicker usage with 24-hour and 12-hour formats, as well as an inline configuration.
```vue
```
--------------------------------
### Implement BBreadcrumb usage
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/layout-components.md
Example showing the structure of a breadcrumb navigation with nested items and active state.
```vue
Products
Electronics
Laptop
```
--------------------------------
### Toast Usage Examples
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/modal-dialog-notice.md
Various configurations for toasts, including simple messages, options with callbacks, and infinite duration.
```javascript
// Simple message
this.$buefy.toast.open('Your changes have been saved')
// With options
this.$buefy.toast.open({
message: 'Operation completed!',
type: 'is-success',
duration: 3000,
position: 'is-bottom-right',
actionText: 'Undo',
onAction: () => console.log('Undo clicked'),
onClose: () => console.log('Toast closed')
})
// Infinite duration (no auto-close)
this.$buefy.toast.open({
message: 'Important notice - close manually',
duration: 0,
type: 'is-warning'
})
```
--------------------------------
### Implement BRadio Group
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/form-controls.md
Example showing how to group multiple BRadio components using the same v-model and name attribute.
```vue
Option 1
Option 2
Option 3
```
--------------------------------
### BCollapse Usage Example
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/layout-components.md
Demonstrates using BCollapse with a trigger slot and v-model binding.
```vue
This content is hidden by default.
```
--------------------------------
### BProgress Usage Examples
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/table-tags-message.md
Demonstrates basic, colored, animated, and stacked progress bars using BProgress and BProgressBar components.
```vue
```
--------------------------------
### Usage of helper utilities in Vue components
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/helpers.md
Demonstrates usage of data manipulation and environment detection helpers within a script setup block.
```vue
```
--------------------------------
### Install Selective Components
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/INDEX.md
Registers individual components to reduce bundle size by only including necessary parts of the library.
```typescript
import { Button, Input, Select } from '@ntohq/buefy-next'
app.use(Button)
app.use(Input)
app.use(Select)
```
--------------------------------
### BMessage Usage Example
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/table-tags-message.md
Demonstrates various message types including success, warning, error, and info with custom icons and event handling.
```vue
Success! Your changes have been saved.
This action cannot be undone.
{{ error.message }}
Please review the requirements before proceeding.
```
--------------------------------
### Update runtime configuration
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/configuration.md
Use setOptions to modify global configuration settings after the library has been installed.
```typescript
import { setOptions } from '@ntohq/buefy-next'
setOptions({
defaultToastDuration: 5000,
defaultToastPosition: 'is-bottom'
})
```
--------------------------------
### Programmatic Usage Example
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/plugin-and-programmatic-api.md
Demonstrates integrating Buefy into a Vue application, including component usage and runtime configuration updates.
```typescript
import { createApp } from 'vue'
import Buefy from '@ntohq/buefy-next'
import { setOptions } from '@ntohq/buefy-next'
import '@ntohq/buefy-next/dist/buefy.css'
const app = createApp({
setup() {
return {
async deleteItem(id) {
// Show confirmation dialog
this.$buefy.dialog.confirm({
message: 'Delete this item permanently?',
type: 'is-danger',
confirmText: 'Delete',
onConfirm: async () => {
// Show loading
const loading = this.$buefy.loading.open({ fullPage: true })
try {
// Delete API call
await fetch(`/api/items/${id}`, { method: 'DELETE' })
// Success notification
this.$buefy.toast.open({
message: 'Item deleted successfully',
type: 'is-success'
})
} catch (error) {
// Error notification
this.$buefy.notification.open({
message: 'Failed to delete item',
type: 'is-danger',
position: 'is-top'
})
} finally {
loading.close()
}
}
})
}
}
}
})
app.use(Buefy, {
defaultToastPosition: 'is-bottom-right',
defaultToastDuration: 2000,
defaultNotificationPosition: 'is-top',
defaultModalCanCancel: ['escape', 'x']
})
// Update config at runtime if needed
setOptions({
defaultToastDuration: 3000
})
app.mount('#app')
```
--------------------------------
### BTag Usage Example
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/table-tags-message.md
Demonstrates basic usage, closable tags with event handling, size variants, rounded corners, and light styling.
```vue
Primary
{{ tag }}
SmallMediumLargeSuccessWarning
```
--------------------------------
### Declarative BLoading Usage
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/modal-dialog-notice.md
Example of using BLoading within a Vue template with v-model binding for state management.
```vue
```
--------------------------------
### BDatetimepicker Usage Example
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/date-time-color.md
Implementation of a datetime picker field using v-model for data binding.
```vue
```
--------------------------------
### BSlider Usage Examples
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/advanced-form-inputs.md
Demonstrates implementation of single sliders, range sliders, and sliders with tick marks using BSlider and BField.
```vue
```
--------------------------------
### BField usage examples
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/form-controls.md
Demonstrates various configurations for BField, including labels, help messages, grouped controls, horizontal layouts, and custom label positioning.
```vue
Enable feature
```
--------------------------------
### Implement BPagination with BTable
Source: https://github.com/ntohq/buefy-next/blob/dev/_autodocs/api-reference/layout-components.md
Example demonstrating how to bind BPagination to a BTable component using v-model and computed properties for data slicing.
```vue