Bulk Actions
<zn-bulk-actions> | ZnBulkActions
Short summary of the component’s intended use.
<zn-bulk-actions actions="[{"id":"agent","name":"agent","options":{"agent1":"Agent 1","agent2":"Agent 2"}},{"id":"company","name":"company","options":{"company1":"Company 1","company2":"Company 2"}},{"id":"impact","name":"impact","options":{"0":"None","10":"Minor","20":"Moderate","30":"Significant","40":"Extensive"}},{"id":"priority","name":"priority","options":{"priority1":"Priority 1","priority2":"Priority 2"}}]" name="actions"> </zn-bulk-actions>
Examples
Basic Usage with Options
Create a bulk actions component with predefined dropdown options for each action.
<zn-bulk-actions actions="[{"id":"status","name":"status","options":{"open":"Open","in_progress":"In Progress","closed":"Closed"}},{"id":"assignee","name":"assignee","options":{"john":"John Doe","jane":"Jane Smith","bob":"Bob Johnson"}}]" name="ticket-actions"> </zn-bulk-actions>
Text Input Fields
Use text input fields for free-form data entry by omitting the options property.
<zn-bulk-actions actions="[{"id":"tag","name":"tag"},{"id":"note","name":"note"},{"id":"reference","name":"reference"}]" name="text-actions"> </zn-bulk-actions>
Number Input Fields
Use the type: "number" property to create number input fields.
<zn-bulk-actions actions="[{"id":"quantity","name":"quantity","type":"number"},{"id":"price","name":"price","type":"number"},{"id":"discount","name":"discount","type":"number"}]" name="number-actions"> </zn-bulk-actions>
Date Input Fields
Use the type: "date" property to create date picker fields.
<zn-bulk-actions actions="[{"id":"start_date","name":"start date","type":"date"},{"id":"end_date","name":"end date","type":"date"},{"id":"due_date","name":"due date","type":"date"}]" name="date-actions"> </zn-bulk-actions>
Boolean Input Fields
Use the type: "bool" or type: "boolean" property to create true/false dropdown
fields.
<zn-bulk-actions actions="[{"id":"active","name":"active","type":"bool"},{"id":"featured","name":"featured","type":"boolean"},{"id":"visible","name":"visible","type":"bool"}]" name="boolean-actions"> </zn-bulk-actions>
Mixed Input Types
Combine different input types in a single bulk actions component.
<zn-bulk-actions actions="[{"id":"category","name":"category","options":{"bug":"Bug","feature":"Feature","improvement":"Improvement"}},{"id":"effort","name":"effort (hours)","type":"number"},{"id":"blocked","name":"blocked","type":"bool"},{"id":"deadline","name":"deadline","type":"date"},{"id":"description","name":"description"}]" name="mixed-actions"> </zn-bulk-actions>
In a Form Context
Use bulk actions within a form to collect structured data for submission.
<form> <h3>Update Multiple Items</h3> <zn-bulk-actions actions="[{"id":"priority","name":"priority","options":{"low":"Low","medium":"Medium","high":"High","critical":"Critical"}},{"id":"department","name":"department","options":{"eng":"Engineering","sales":"Sales","support":"Support"}}]" name="bulk-update"> </zn-bulk-actions> <br /> <zn-button type="submit" color="success">Apply Changes</zn-button> </form>
Importing
If you’re using the autoloader or the traditional loader, you can ignore this section. Otherwise, feel free to use any of the following snippets to cherry pick this component.
To import this component from the CDN using a script tag:
<script type="module" src="https://cdn.jsdelivr.net/npm/@kubex/zinc@1.0.86/dist/components/bulk-actions/bulk-actions.js"></script>
To import this component from the CDN using a JavaScript import:
import 'https://cdn.jsdelivr.net/npm/@kubex/zinc@1.0.86/dist/components/bulk-actions/bulk-actions.js';
To import this component using a bundler:
import '@kubex/zinc/dist/components/bulk-actions/bulk-actions.js';
Slots
| Name | Description |
|---|---|
| (default) | The default slot. |
example
|
An example slot. |
Learn more about using slots.
Events
| Name | React Event | Description | Event Detail |
|---|---|---|---|
zn-event-name |
|
Emitted as an example. | - |
Learn more about events.
Custom Properties
| Name | Description | Default |
|---|---|---|
--example |
An example CSS custom property. |
Learn more about customizing CSS custom properties.
Parts
| Name | Description |
|---|---|
base |
The component’s base wrapper. |
Learn more about customizing CSS parts.
Dependencies
This component automatically imports the following dependencies.
<zn-button><zn-example><zn-icon><zn-input><zn-opt-group><zn-option><zn-popup><zn-select><zn-tag><zn-tooltip>